Not able to understand the solution

can you provide a solution with comments for better understanding?

hi @arugarg,

here’s the commented code dry run for the eg test case for better understanding https://ide.codingblocks.com/s/65772

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.

@arugarg is the doubt clear?

the link you provided isn’t working. can you reshare it?

@arugarg try one copy pasting the url in chrome

@arugarg is it working?

@arugarg,

no, it is not working

@arugarg check the pic hope u r able to see

@arugarg or check this https://ide.codingblocks.com/s/658919

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.