Ad
  • Custom User Avatar

    Mutating the input array breaks the random tests.

  • Custom User Avatar

    It's unclear what is being passed into the function whatever. A natural implementation would assume something like Enumerable.inject: whatever(1, 1) { |a, b| a + b }, but turns out we're just stuffing a raw string inside? And not even whatever(1, 1, 1, "* + * ... *")?

    This is very unexpected, and certainly doesn't look like a good design for this at all, when there is stuff like Set.new([1, 2, 3]), *.map(&:succ).to_set ... * in the random tests, and the whole thing turns into "how to parse the input good enough". I do not think "parsing syntax that emulates another language" is the supposed difficulty of this kata.

  • Custom User Avatar

    This task is no different from all the "check if parentheses are correct" katas.

  • Default User Avatar

    I feel this Kata is too similar to Almost Even

  • Custom User Avatar
  • Custom User Avatar

    No random tests.

  • Custom User Avatar

    the variance of share to be as small as possible

    Could you explain what do you really want? distribute(50, [6, 4, 3, 0, 5, 2, 3]). After distributing candies we get [12, 8, 6, 0, 10, 4, 6] and 4 leftovers. Why do we give 2 candies to child #2 and child #5 each getting [12, 8, 8, 0, 10, 6, 6] when we could give all 4 candies to child #3 and get [12, 8, 6, 4, 10, 4, 6], thus actually changing the share variance?

    If children with share receiving weight == 0 don't deserve candies at all, you should mention this in the description.