Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This implementation didn't work for test:
assertEquals("nottest", Solution.lcs("notatest", "anothertest"));
Got your point, Thanks. Now, I am wondering why do they complicate in books and try to backtrack along the diagonal which is so complex to implement.
This comment is hidden because it contains spoiler information about the solution
I did not get the backtracking loop. I followed the WiKi, started from the bottom right. THe process moved up or sidewas as much as possible. Only when this was not possible, it moved diagonal and checked if value decrement. Thus, tougher one.
Your is so simple. Can you please shed some light on it?
Maybe something wrong with this solution, try this:
s = " we*can!"
part1 = " a!"
part2 = " wecn"
You can see here that s has a "*" but part1 and part2 don't.