Ad
  • 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?