Count number of ways to reach a given score in a game

Can someone elaborate how this dp problem works:

Read this. Same problem, explained better. The method used in the article you provided is the “O(nm) time O(n) space optimized method” at the very end.

1 Like