You are viewing a single comment's thread. Return to all comments →
def appendAndDelete(s, t, k): if len(t) + len(s) <= k: return "Yes" while k > 0: if s > t: s = s[:-1] k -= 1 elif s == t: return "Yes" else: print(s) if s == t[:len(s)]: if (k - (len(t)-len(s))) % 2 == 0 and k >= len(t)-len(s): return "Yes" return "No" else: s = s[:-1] k -= 1 return "No"
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 →
Python3 Solution