Lets say we have to strings, A and B. The task is to insert any needed letters in the string B in order to end up with the string A.
For example:
A - This is just a simple test
B - is t a sim te
So if we look at the string A like this:
--is -- ---t a sim--- te--
or:
---- is ---t a sim--- te--
it is clear that we can build string A from the string B, and the output should be in the above written format (both answers are correct).
Can you think of an algorithm that will solve this in the reasonable time? It is quite easy to come up with brute force solution, but I need something a bit more sophisticated than that.
--i- -s ---t a sim--- te--also a valid solution for your example?