Is my logic correct in code-
Here is my code-
Is my logic to solve the problem using recursion correct?
Hello @pragyachoudhary1111,
Your code is failing for the test cases like:
alllott
I have corrected it:
Hope, this would help.
Give a like if you are satisfied.
what if I started my for loop of j from ith position instead of i+1…then my code would have been correct?
Hello @pragyachoudhary1111,
I would suggest you to think it yourself first.
- Try to understand the changes i have made.
- Identify your mistake by comparing it with the code i have corrected.
Hint:
Dry run your code to understand the flow of your code.
It is very important for you to understand how the code you have written is executing.
Try to understand it yourself first.
Let me know if you still face any issue.