Ladder 1 getting wrong answer

@avinashmallik2017
the inner j-loop will be like this for your code :- for(ll j=i-1; j>=0 && i-j<=k; j–)
because jump to i can be from atmost kth distance far previous index.

@avinashmallik2017
Feel free to ask if any other doubt in this.
If its clear then please mark the doubt as resolved after getting AC on submitting.

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.