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.
Cool! I did something similar except I used tail recursion (with a helper function that had an accumulator). This cuts down a little on the space complexity, otherwise need to save the stack trace of each call to persistence so that the result can be summed to 1 in the return statement
This comment is hidden because it contains spoiler information about the solution
It's concise and cool but isn't the time complexity O(n^2)? you can do it with O(n) complexity by doing a first pass over the string to record counts of each character in an array (can explit the convertability of ASCII characters to integers) although there is a tradeoff in space complexity and verbosity...
I usually avoid recursive algorithms when easy iterative solutions exist because of the savings in space from the buffered function calls... not to mention the overhead for all the new LinkedLists that are instantiated. Looks cool though.