How to avoid duplicate combinations in DFS probs

using an index along with function call helps. which can be further memorized.
Check Coin Change II problem

Pasted image 20250201234033.png