Please Give The Explanation With Example

Please If Possible Could You Post Some Pictorial Example with 2 string, It is hard to imagine unique state here, Still I am not able to contradict why the given recursive solution will define unique state not previous solution discussed in the video session.

In such questions, i understand that its hard to visualize weather you will have repeating calls or not.
For this question , you wont find a case if you try to try run but you can visualize that you might come to a place with “k items remaining…” and " modulous till now is x…’" and “digit position is some y…” or anything like that.
So in these type of cases, we need to use DP bcz there is a good chance of going to a state again and again.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.