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.
I tested functional programming vs a for loop and it seems like the for loop can be about 100ms faster than the functional programming approach. Not too sure why
Agreed, I remember reading that somewhere -- but why? because of the lambda function, right?
Actually not the best practice. List comprehension would be more fitting
okay....i figured it out completely....thank god....
testing with
test.assert_equals(lcs("8a4" , "8b4"), "84")
and it works, however im having trouble to understand why it works, this codereturn lcs(x[:-1], y[:-1]) + x[-1]
was returned 3times as follows: "4","8","8", so shouldn't the result be like '844'? why is it 84 instead....The complexity is 2^n. if string length is very large, this method maybe very slow