Ad
  • Custom User Avatar

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

  • Custom User Avatar

    Clean code, but a rather greedy approach in terms of resources, as you will have to process all the list and store all the numbers a second time to get to the result.

  • Custom User Avatar

    In Dart, the test expect the player function to have parameters that are dynamic lists instead of List<int> and thus will throw an error. Not a huge issue, but since the Katas are about writing good code, and good code has conservative type annotations, it "spoils" the Kata a bit.

  • Custom User Avatar

    In Dart (or at least in the way I coded the solution) the floating point value of some numbers that the tests expect to be round (say 80) is slightly shy of it (say 79.999999999998). When flooring as per instructions, the result becomes 79 instead of the expected 80.

    Eventually I figured out what the problem was, and corrected it by simply adding 0.000001 to all my results before flooring them, however I think the test cases should be revised to eliminate this issue, as it adds nothing to the experience (it's not by chance that I found this Kata by picking the first hit when ranking for for "low satisfaction" at 7 kyu).

    Also in case somebody is interested: https://en.wikipedia.org/wiki/Potato_paradox

  • Custom User Avatar

    In Dart, the random test do not use immutable lists as input, as a result if the solution alters the original list, the test will fail.

    In my case, since I was removing items from the list, the test expected the "correct" solution to be an empty list [].
    I believe this is because the expected solution is computed after the actual one has ran.