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.
when did n choose k permutations become fundamentals; I feel like this should be listed as a maths problem
This comment is hidden because it contains spoiler information about the solution
Ah I see, thanks for your help :)
Ruby random tests expected result should be calculated before calling the user's function to avoid input mutation problems.
I was, I used String.slice! to remove portions of the string and insert them into an array. My return conditionals were placed above that code.
If I change the code so I'm calling slice! on a clone instead, the code works, but I can't figure out why.
Are you somehow destroying the input value? Strings are mutable in Ruby.
Maybe someone can help me; when I run my solution it passes the basic tests but it immediately fails on the first random test no matter what.
All the tests it fails on require me to return an empty string. At the top of my method I have an if conditional that returns an empty string
if the the first argument is an empty string, if the second argument is greater than the length of the first argument, or if the second argument
is less than or equal to zero. What exactly am I missing here?
pretty bad description, you say if pockets == nil i.e. if the first argument is nil, but what you really mean is if all the values in the hash are nil or empty arrays, or if the hash itself is empty.
This problem gave me clinical depression