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 comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
The test code in the Javascript version has a comment with a pound sign (#) when it should be a double slash (//). That's causing the tests to not run.
This comment is hidden because it contains spoiler information about the solution
Thanks, fixed that too. Also another bug I had.
You are correct, I missed that one!
I call it the "cut and paste framework" :)
It doesn't have an upper bound since it shuffles randomly. If the shuffle algorithm was modified to permute the list to every combination, then I believe that it would have O(n!) complexity, but as it stands, it's effectively O(∞).
Yep :)
https://en.wikipedia.org/wiki/Bogosort
And perhaps check for the corner case:
Test.expect(solution('Test', 4) == 'Test', 'solution("Test", 4) did not return "Test"')