Want hint............ccccccccccccccccccc

want hint…
how to use the loop for left and light

Hello @amit0001 in this question you can use the two pointer approach with the for loop in this:
like for every currect element you can check the if the elements are from that range to the end with the help of 2 pointer approach gives you the desired sum or not:
Here for your reference i am giving you the code:


if you have any doubt you can ask here:
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.