Ad
  • Custom User Avatar

    ( JS )

    Example tests: it("123 is 25+25+25+25+10+10+1+1", () => { is missing one + 1.

    There may be more.

  • Custom User Avatar

    The task stated by the kata is

    given a set of coin denominations determine the fewest number of coins required to add up to a given amount

    It didn't tell us to calculate the amount of coins as determined by a greedy algorithm. In fact both are incompatible, since a greedy algorithm is not a correct algorithm. So the description at it is right now is unacceptable.

  • Custom User Avatar

    The kata only guarantees that "all amounts given will be solvable" and "a greedy algorithm should be used", but does not guarantee that the solution can be reached via a greedy algorithm, e.g: 9 and [5,3].

  • Custom User Avatar

    I have attempted to translate to Ruby

  • Custom User Avatar

    Requiring the solution to handle unsorted denominations seems silly.

    • The denominations represent coins denomination in some currency, right?
    • But that is a well-known set, and would never in practice be passed around in random order
    • So testing unsorted coin denominations adds nothing to this Kata except the annoying necessity for all solutions to have up-front sort.

    why?

  • Default User Avatar

    There is something strangely back-to-front with this Kata because the premise of it is that "No one enjoys carrying around spare change", and yet the requirement of the Kata is to try to pay for something using the minimum number of coins.

    IMO if you don't like carrying coins then you should be trying to get rid of the maximum number of them! ;-)