Ad
  • Custom User Avatar

    We really need a ping system, I only just saw this now. I asked him but he doesn't wanna maybe?.

  • Custom User Avatar

    @Kacarott, can this one be awesomised aswel?

  • Custom User Avatar

    Generally if you run into issues like that it means it's not about "optimizing" your solution but actually starting from scratch and finding a different approach that works. The correct solution to this kata solves it in a fraction of a second. Basically you need to rethink your approach. I can't say more or it would be a spoiler.

  • Default User Avatar

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

  • Default User Avatar

    added more helpful messages

  • Custom User Avatar
  • Custom User Avatar

    Never mind, I get it. You're turning the whole box to the right, while the question describes a magical box that changes gravity without turning it.

  • Custom User Avatar

    Sorry for the late reply, but if you're still confused, could you please explain how you got [1, 3, 4]?

  • Default User Avatar

    This case you asking about is in kata description. Look close at it please.
    It is [1, 3, 4] if you count number of blocks per row, if you count number of blocks per column you get [1, 2, 2, 3].

  • Default User Avatar

    In example gravity pulls from left to right, to get [1, 3, 4] you mentioned boxes have to actually go up. For me it looks like you misunderstood dimensions, this numbers are columns of blocks not rows.

  • Custom User Avatar

    bc returns correct digits when rounding properly do not match example's result.

  • Custom User Avatar

    what??

  • Custom User Avatar

    the C code has been updated, please let me know if you still have any reason for thinking there's a wrong test

  • Default User Avatar

    After running someone else's code through the tests, the test appears to be in the wrong. Although your code takes an argument of type "char * ", for one of the fixed tests you are passed in a "const char * ". When you try writing to it, your code probably crashes - it's trying to write to read-only memory.

    In my view, the test should be changed to allocate memory, copy the argument into that memory, and pass it to your code.

  • Custom User Avatar

    return true, return false.

  • Loading more items...