Problem: https://cses.fi/problemset/task/1638
This is computing the number of paths in a DAG. We can actually think about any DP as operating on a DAG, where the states are vertices and the transitions are edges. Not allowing cycles is the same as saying there's some valid order (a topological order of the DAG) to compute the DP values in.