You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (i == len(s) - 1 or i == len(t) - 1) and s[i] == t[i] :
number_diff = (len(s) - i - 1) + (len(t) - i - 1)
else:
number_diff = (len(s) - i) + (len(t) - i)
#first condition checks whether both are even or both are odd ! because if that happens to be true then (k - diff) will always be even and string can always be build. HOW ?by appending then deleting or vice-versa.
#second condition means delete the whole s string and append the whole t string.
if (number_diff <= k and number_diff % 2 == k % 2) or (len(s) + len(t) < k):