The topological ordering something can be unclear in this type. So recursion + memoization is the way to go.
Last updated 6 years ago