Count Ways to Score in a Game
Let's solve the Count Ways to Score in a Game problem using Dynamic Programming.
Statement
Suppose there is a game where a player can score either
Note: You may assume that you can use a specific score as many times as you want. Additionally, the order in which we select scores from the list is significant.
Let's say the total points to be earned are
and , in three turns: . and then a , in two turns: . and then a , in two turns: .
Constraints:
<= <=
Examples
Level up your interview prep. Join Educative to access 70+ hands-on prep courses.