This question already has an answer here:
- Need change of 78 cents [closed] 5 answers
Challenge: given a number, calculate how many unique, order-independent ways there are to achieve a score of that number in American Football.
Let's see how few characters can be used in each of your favorite languages! The usual rules apply. Input and output in a way that is natural to your language.
Recall that the ways to score in Football are safety (2 points), field goal (3 points), touchdown (6 points), touchdown + extra point (7 points), and touchdown + 2-point conversion (8 points).
For example, given 9 as input, the program should return 4, since you could score:
- 1 touchdown + extra point and 1 safety
- 1 touchdown and 1 field goal
- 3 field goals
- 3 safeties and 1 field goal
Note that order does not matter.