Please tell me why this code is not passing test cases

Please correct the code and tell me my mistake

hi @KetanPandey your code is not running even for sample test case, please see that you are using the correct code.

i have done from my side.Please correct the code.It would be of great help.I have already spent more than 1 hour correcting it

@KetanPandey please share the updated code by saving it on ide. The code in your submission is not even running for the sample input, that’s why i wasnt sure if that’s the code you intend to share

i have shared the link above.Please do comment so that i can understand my mistake

@KetanPandey it is quite a simple mistake
image
you are using variable i and j for recursion, and in the base case, you are using i and j in the loops also, so just use some other variable name for the loop and it will be fine

Thank u maam.I was searching this mistake since long.Is there any way through which i can conncet with u.U solved my doubt too efficiently

@KetanPandey please mark your doubt as resolved. You can use the ask doubt section for any future doubts. Happy learning!

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.