You are viewing a single comment's thread. Return to all comments →
Simple python3 solution:
See more solutions here, let me know if any need explaining!
s = input().strip() t = input().strip() k = int(input().strip()) numSameChars = min(len(s), len(t)) for i in range(len(t)): if s[:i] != t[:i]: numSameChars = i-1 break diff = len(s)-numSameChars + len(t)-numSameChars print('Yes' if (diff <= k and diff%2 == k%2) or len(s) + len(t) < k else 'No')
Append and Delete
You are viewing a single comment's thread. Return to all comments →
Simple python3 solution:
See more solutions here, let me know if any need explaining!