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.
Not enough information for an issue.
It seems that you are using a brute force solution. there are more than 100 testcases in Ruby version.
All 50 tests pass but I keep getting this error...
'each': failed to allocate memory (NoMemoryError)
There seems to be some error. The third test is expecting "mountains", which I am getting in my IDE however the test repeatedly fails. Not sure why.
For some reason codewars won't run the test on my code. It just draws a blank. Not sure what's going on but it works in the IDE.
This comment is hidden because it contains spoiler information about the solution
Because when you convert a normal (denary) number into another base (binary), it turns it into a string but includes the what base it is as a prefix. "0b" - binary, "0o" - octal, "0x" - hexadecimal.
When you use bin(), it adds this prefix on to the number (so it becomes "0b10"). Simply filter out the first two characters in the string you are returning.
You need to return the value instead of printing it, all katas on this website work like this :). Just either remove puts or remove puts and add return, both do the same thing but not adding return evaluates the last thing, so return isn't needed.
This comment is hidden because it contains spoiler information about the solution