6
1
You bought a tasty Orange in the supermarket and got 78 cents change. How many possible ways the supermarket guy can give you the change using 1,5,10 or 25 coins
- Input: Change amount
- Output: The number of possible ways to give the change.
Order is not important 1,5 is same as 5,1
Win conditions:
- Best performance
- Shortest code
Also please add the result for 78 in your title.
1wait, what, the task is to discard the input and output a constant? – John Dvorak – 2013-12-13T09:14:25.303
@JanDvorak is it more clear to you now? – Ilya Gazman – 2013-12-13T09:21:37.863
If the input is not guaranteed to be 78, perhaps you should specify that? So far, it's "output a precomputed constant" – John Dvorak – 2013-12-13T09:22:07.830
@JanDvorak just did – Ilya Gazman – 2013-12-13T09:27:08.807
Negative. The input is still a constant 78. Did you mean "got n cents change ... add the result for n=78"? – John Dvorak – 2013-12-13T09:27:55.913
3How are you planning to measure "best performance"? (Also, I've retagged from [tag:code-golf] to [tag:code-challenge] on the grounds that you're asking for a criterion other than length of code. Although [tag:code-challenge] is a stretch too because it's a trivial problem). – Peter Taylor – 2013-12-13T09:30:49.897
or, should I edit the question myself when I get home (just leaving)? – John Dvorak – 2013-12-13T10:01:15.450
@JanDvorak yeah please edit it. – Ilya Gazman – 2013-12-13T10:03:57.200
@Babibu also, you should clarify if 5+1 counts the same as 1+5 – John Dvorak – 2013-12-13T10:53:46.610
@JanDvorak done – Ilya Gazman – 2013-12-13T11:19:36.177
If the output should be "[t]he number of possible ways to give the change", how can
1,5
or5,1
be valid outputs? – Sven Hohenstein – 2013-12-13T12:28:16.353@SvenHohenstein 5,1 is a way to pay six cents, not the program output. – John Dvorak – 2013-12-13T12:32:33.053
@SvenHohenstein So just edit by your self – Ilya Gazman – 2013-12-13T14:31:46.267
3Your winning conditions are not very objective. Which is more important? Speed or chars? What about lengthy but speedy answers? What about short but not-so-fast answers? – Justin – 2013-12-13T18:25:19.880
@Quincunx 1 is more important then 2. You are welcome to edit the post to make it more clear – Ilya Gazman – 2013-12-14T10:24:13.287