Dynamic Programming, Programming, Algorithms, Data, Coding Interviews.
space is very large or exponential, that problem can be solved using dynamic programming. The reason is simple: recursion will have to explore all possible solution candidates, which is exponential in the count. Any such recursive solution may lead to repeated sub-problems scenarios. Enjoy