Ad
  • Custom User Avatar

    9 is the wrong answer because you should have 10 hooks.

    One corner of your curtain is hanging unsupported.

  • Default User Avatar

    I absolutely agree with you, this situation also causes misunderstanding :(

    and then in the second example where the length of the curtain is 180
    [0-20][20-40][40-60][60-80][80-100][100-120][120-140][140-160][160-180]
    the maximum permissible length between the hooks is 22, and I have only 20. Why then 9 is the wrong answer, where did 17 come from?

    and please note I don't measure anything, I just fold the curtain in half ((((

  • Custom User Avatar

    You're not crazy. But how are you going to measure 45? You can't, not in this kata.

    You can only get 112.5 from 225 without measuring.

  • Custom User Avatar

    This is just bizarre. The first test expects a result of 9 on a test of numberOfHooks(225, 45) ??
    45 is a factor of 225.

    Consider brackets ([]) as the external hooks and pipes (|) as inner hooks.
    [0 - 45 | 45 - 90 | 90 - 135 | 135 - 180 | 180 - 225 ]

    Count 'em. 6.

    Am I crazy or is this kata nuts?

    The hell is going on here?