Overlapping subproblems #
In this problem, it is a little hard to see overlapping problems, since they do not follow a specific pattern. But if you look closely, you will notice capacity and index tuple are oftentimes repeating. All of these subproblems have the same answers. Look at the following visualization.
in the graph show different value for the same capacity and index
how could it be Overlapping subproblems?