Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Mutating the input array breaks the random tests.
It's unclear what is being passed into the function
whatever
. A natural implementation would assume something likeEnumerable.inject
:whatever(1, 1) { |a, b| a + b }
, but turns out we're just stuffing a raw string inside? And not evenwhatever(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.This task is no different from all the "check if parentheses are correct" katas.
I feel this Kata is too similar to Almost Even
This is a duplicate of https://www.codewars.com/kata/5bc001de6aab18fba5000066
No random tests.
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]
and4
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.