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 just updated the one test to not require a particular order of the output prefix array. Also modified the description slightly to try and address @myginxin2015's question.
You both bring up good points. I created this kata really fast just for my own practice and definitely need more tests and better tests. I'd like the tests to REALLY not require a sorted prefix array output. =)
@myjinxin2015 I tried to explain in the description that, for this kata, assume no word in the list is the prefix of another word. So you would never be given an input words array containing "dog" and "dogz" or "tree" and "trees". Perhaps I can improve the description to avoid any confusion.
This comment is hidden because it contains spoiler information about the solution
You can initialize i to 1 as a minor optimization. Adding 0 to the sum isn't necessary.