Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change: description and examples do not match #1283

Closed
abeger opened this issue Aug 2, 2018 · 3 comments
Closed

change: description and examples do not match #1283

abeger opened this issue Aug 2, 2018 · 3 comments

Comments

@abeger
Copy link
Contributor

abeger commented Aug 2, 2018

The description states that the output is an array that lists the amounts of each coin needed:

  • An input of 15 with [1, 5, 10, 25, 100] should return one nickel (5)
    and one dime (10) or [0, 1, 1, 0, 0]
  • An input of 40 with [1, 5, 10, 25, 100] should return one nickel (5)
    and one dime (10) and one quarter (25) or [0, 1, 1, 1, 0]

However the tests state that the output is an array of individual coins

      "input": {
        "coins": [2, 5, 10, 20, 50],
        "target": 21
      },
      "expected": [2, 2, 2, 5, 10]
@petertseng
Copy link
Member

Anyone who has opinions on which it should be should speak now. It is known that the tracks that had this exercise in July (the most recent data available) were all using list of coins, such as [5, 10], rather than lists of counts, such as [0, 1, 1, 0, 0].

the list of tracks that had this exercise in July:

clojure/exercises/change
csharp/exercises/change
ecmascript/exercises/change
elixir/exercises/change
fsharp/exercises/change
go/exercises/change
haskell/exercises/change
java/exercises/change
javascript/exercises/change
kotlin/exercises/change
lua/exercises/change
ocaml/exercises/change
php/exercises/change
python/exercises/change
reasonml/exercises/change
ruby/exercises/change
scala/exercises/change

@petertseng
Copy link
Member

I would consider a list of coins clearer than an uncontextualised list of counts, so I prefer the list of coins.

Another option I would consider is a mapping of coin to count. I'd accept {5 => 3, 10 => 4} to represent [5, 5, 5, 10, 10, 10, 10].

@ErikSchierboom
Copy link
Member

I also prefer the list of coins, as it best represents one having actual change in their hands I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants