Count Ways to Score in a Game
Explore how to count the number of ways to achieve a target score in a game where scoring options are 1, 2, or 4 points per turn. Understand the naive recursive approach and optimize it using dynamic programming with memoization and tabulation methods for better performance and scalability.
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: ...