Append and Delete
Solutions The challenging part of this exercise is how to handle operations in excess.
If a string is empty, we can consume as many operations we want (as the problem specifies).
So, the easy case is when we have a number of operations that is greater than the sum of length of both strings. In this case the solution is “Yes” because we can just remove all the characters from one, consume excess operations by repeatedly performing the second operation from the empty string, and finally appending the other characters.
[Read More]