Ad
  • Custom User Avatar

    I'm trying to figure out n = 12 and this is how to get 9 and 3

    n = 12
    Alice Turn: Alice = 1, Bob = 0, Remain = 12 - 1= 11
    Bob Turn: Alice = 1, Bob = 1, Remain = 12 - 2 = 10
    Alice Turn: Alice = 5 + 1 = 6, Bob = 1, Remain = 12 - 7 = 5
    Bob Turn: Alice = 6, Bob = 1 + 1 = 2, Remain = 12 - 8 = 4
    Alice Turn: Alice = 6 + 1 = 7, Bob = 2, Remain = 12 - 9 = 3
    Bob Turn: Alice = 8, Bob = 2 + 1 = 3, Remain = 1
    Alice Turn: Alice = 8 + 1 = 9, Bob = 3, Remain = 0

  • Custom User Avatar

    Ranking is too high, it should be a 7.

  • Custom User Avatar

    Nice kata but it's not a level 5 at best it's an easy 6.

  • Custom User Avatar

    This kata is more difficult than an 8!

  • Custom User Avatar

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

  • Custom User Avatar

    OK I have it now. 10 guesses is sufficent to solve any number between 1 and 1000!

    Thanks for your help.

  • Custom User Avatar

    OK,

    So I have 10 guesses to figure out a number between 1 and 1000: Lets say the number to be guessed is 345.

    Now my first guess is 500 obviously too high, I then refine my guess to pick a random number between 1 and 500.

    I continue refining the range of the guess depending on the result of the previous guess. So for example, my second guess is 200 which is too low then my third guess will be between 200 and 500. One can easily use up the 10 guesses without reaching the correct number in 10 guesses. It is not possible to make it more efficent than that!

    So my issue is still boils down to what to I do if I don't guess the correct number within 10 guesses?

  • Custom User Avatar

    I have a solution to this kata, it works fine when I guess the number within 10 guesses. However I can't figure out what I'm supposed to do if I fail to find the number within 10 guesses.

    For example this is the message I get: "you guessed 604, but the number was 600: expected 604 to equal 600"

    Any suggestions as to what I can do to finish this kata will e gratefully accepted.

  • Custom User Avatar

    This one has me totally stumped:

    I have no idea how you can get sum(2) = 22 and sum(3) = 50 from the formula given.

    Can someone explain it to me?

  • Custom User Avatar

    I think this is more than a level 7.

  • Custom User Avatar

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

  • Custom User Avatar

    I'm not sure about this Kata, it is too easy to google a valid solution (that's what I did, so I did not submit my solution). If one was to solve it from scratch then it would be far more difficult than a level 6!

  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

    Coding the solution was easy, the difficult part was figuring out what was meant by sumax.

    Hint the table is a countdown version of the example table.

  • Loading more items...