Please explain the two pointer approach for this question

i am not able to understand the two pointer approach for this question, given in the editorial.

hello @agarwalarjit.agarwal
pls refer this article link
this article has 4 approaches , and to understand 2 pointers u need to understand 1st three approaches first., so i would recommend to read all those approaches , then jump to 2 pointer approach,then watch the animation video , and do a dry run.
even after doing that if u remain with any doubt then feel free to ask

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.