Ad
  • Custom User Avatar

    Once again, you're correct. :)

    I've made the necessary corrections to the Kata!

  • Custom User Avatar

    There is this test case in testStaticSquads:

    assertEquals(55, new FallGuysRace().findMinFinishes(12, 4, new int[] {
       9,  6, 11,  5,  8, 14,  9,  2,  4,  1,
       7,  7,  9,  3,  3, 15, 10, 11, 12,  1,
       9,  8, 10,  7, 13, 10,  2, 12, 16, 13,
       5, 14, 13, 14, 15,  2, 11,  7, 16, 10,
       2,  5,  1,  1, 13, 16, 11,  3, 14, 12,
      15, 16,  8,  5,  3, 12, 15,  4,  8,  6,
       6,  4,  4,  6}));
    

    After 55 rounds the scoreboard is as follows:

    #1  Team  9: 218 points (Final)
    #2  Team  7: 175 points (Final)
    #3  Team 11: 155 points (Final)
    #4  Team 10: 154 points (Final)
    #5  Team  2: 148 points (Final)
    #6  Team  1: 143 points (Final)
    #7  Team 14: 139 points (Final)
    #8  Team  5: 129 points (Final)
    #9  Team  3: 128 points (Final)
    #10 Team 13: 127 points (Final)
    #11 Team  8: 115 points (Max: 115 + 9 = 124, Min: 115 + 1 = 116)
    #12 Team 12:  98 points (Max:  98 + 9 = 107, Min:  98 + 1 =  99)
    -------------------- CUTOFF --------------------
    #13 Team 16:  94 points (Final)
    #14 Team 15:  93 points (Max:  93 + 9 = 102, Min:  93 + 1 =  94)
    #15 Team  6:  63 points (Max:  63 + 9 + 8 + 7 = 87, Min: 63 + 3 + 2 + 1 = 69)
    #16 Team  4:  56 points (Max:  56 + 9 + 8 + 7 = 80, Min: 56 + 3 + 2 + 1 = 62)
    

    Team 15 (#14) can still overtake Team 12 (#12), so the race shouldn't end here. It should end next round (when the final runner of Team 12 finishes the race and gets 9 points).

  • Custom User Avatar

    As you have suggested, I added some further examples showing some edge cases which better illustrate the full requirements.

  • Custom User Avatar

    You are correct, I'll make the appropriate update to account for the minimum remaining points a team can possibly score when determining a rank change.

    Edit:
    I have corrected the calculation and have also updated the examples to exercise the case you described.

  • Custom User Avatar

    If the points an individual player would receive for finishing affects the qualification ranking in any way then they must continue to broadcast the race until they cross the finish line

    The expected result in the kata is contradictory to what is specified. See the last example test:

    limit = 2
    teamSize = 3
    order = {1, 1, 2, 2, 3, 3, 3, 2, 1}
    

    After 5 players have finished:

    Team 1: 17 (9 + 8) points, max possible: 21 (17 + 4)     points, min possible: 18 (17 + 1)     points
    Team 2: 13 (7 + 6) points, max possible: 17 (13 + 4)     points, min possible: 14 (13 + 1)     points
    Team 3:  5         points, max possible: 12 ( 5 + 4 + 3) points, min possible:  8 ( 5 + 2 + 1) points
    

    As Team 1 will at least net 18 points while Team 2 can at most net 17 points, the result is curtains and there is no need to look further. Did the kata forgot to account for the minimum points that can be obtained by a leading team's remaining players?

  • Custom User Avatar

    I don't think the kata does a good job of illustrating the full requirement of the kata: the examples in the description only feature the trivial parts of the rules, and only the last fixed test sort of covers the simplest case of this.

  • Custom User Avatar

    Thanks, I've removed the JavaScript translation. It was an "inserted example" error on my part.

  • Custom User Avatar

    Javascript version needs to be updated to reflect the Java version, or unpublished entirely. The tasks are completely different.