Ad
  • Custom User Avatar
  • Custom User Avatar
    • No random tests in JS and ruby at least
  • Default User Avatar

    Is the implementation of counter() method taking care of returing the i? My code is running properly on my local machine (where I've implemented a simple Counter class with counter() and a println) but when I migrate the countInThreads logic to this kata it fails. I wonder what's the implementation of Counter class here

  • Custom User Avatar

    Hi,

    I appear to have some issue with my code...when I run my attempted solution against 'Run Sample Test' or 'Submit'. I get the following output:

    Process was terminated. It took longer than 20000ms to complete.

    Yet, on my machine my run takes between 2ms to 13ms for any given run, after having run it around 50 times. I'm certain it's something I am doing.., Perhaps I'm doing something wrong with the Testing...I have my solution uploaded to a github repo (along with some test code I wrote), I was wondering if it's something you could have a look at please?

    Many thanks!

  • Custom User Avatar

    There is something I do not quite get about this question.
    if this is a swap game then your description is not quite clear to me.
    In the description,

    For example, given the starting position 0 and the swap sequence [(0, 1), (1, 2), (1, 0)]:
    
    The first swap moves the ball from 0 to 1
    The second swap moves the ball from 1 to 2
    The final swap doesn't affect the position of the ball.
    

    Why isn't the final swap having an effect? Shouldn't the ball be able to move from 2 to 1 and then 1 to 0? How is there no effect? Unless the is no moving backwards.

  • Custom User Avatar

    I don't know if it's possible, but some better error messaging would be great. I was stuck with "Unknown error" for the longest time (which is why I think it might not be possible--Codewars, not kata, issue), and eventually had to transfer the code to my local environment to find out what was going on.