Ad
  • Custom User Avatar

    It looks like we are expected to include a .equals method as well even though it is not specified.

  • Custom User Avatar

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

  • Custom User Avatar

    There is no test written for the JS version and the submit button only checks one case. So still substantially incomplete.

  • Custom User Avatar

    Only the first player gets the freedom to pick any of the 3 numbers. The first move of the second player is subject to the restriction. So if you start with 2 cakes and volunteer to play first, picking 1 will stalemate your opponent and you are forced to eat the last cake.

  • Custom User Avatar

    My implementation suffered from some rounding issues due to the double number type. All the test cases still seem to be integers but I did not want to break the possibility of it working with non-integers.

    Anyway I ended up doing some slightly ugly casting to C# decimal and back at critical points where I thought the rounding error might be occurring. This did not seem to penalize performance much and it passed the tests.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

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