You are viewing a single comment's thread. Return to all comments →
Isn't
(k - diff) % 2 == 0
the same as
k%2 == diff%2
since whenever you subtract a number from another, the following rules:
a=even, b=even a-b=even a=odd, b=odd a-b=even a=odd, b=even a-b=odd a=even, b=odd a-b=odd
So suppose: # k = 6 s = 'abcdefghij' # diff = 4 t = 'abcdef' (k - diff) % 2 = (6 - 4) % 2 = 2 % 2 == 0 True
Seems like cookies are disabled on this browser, please enable them to open this website
Append and Delete
You are viewing a single comment's thread. Return to all comments →
Isn't
the same as
since whenever you subtract a number from another, the following rules: