Ad
  • Custom User Avatar

    Not enough information for an issue.

  • Custom User Avatar

    It seems that you are using a brute force solution. there are  more than 100 testcases in Ruby version.

  • Custom User Avatar

    All 50 tests pass but I keep getting this error...
    'each': failed to allocate memory (NoMemoryError)

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution