We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Test-3 s = "zzzzz" t = "zzzzzzz" k = 4 , how come the answer should be "Yes"? I mean how it is possible to convert s into t with exactly 4 operations? That is if we perform two append-operations and two delete-operations, with 4 operations the strings won't be same. On the otherhand if we perform four append-operations and two delete-operations the strings will be same but number of operations > k, Thus, probably the test is not correct.
Append and Delete
You are viewing a single comment's thread. Return to all comments →
Test-3 s = "zzzzz" t = "zzzzzzz" k = 4 , how come the answer should be "Yes"? I mean how it is possible to convert s into t with exactly 4 operations? That is if we perform two append-operations and two delete-operations, with 4 operations the strings won't be same. On the otherhand if we perform four append-operations and two delete-operations the strings will be same but number of operations > k, Thus, probably the test is not correct.
you can append one, delete one and then append two
I never thought about that, now I get it. Thanks !