Subarray with sum 0

what if we want the index of elements of array which containing 0 ??

s.find(pre)!=s.end() what this line means ?? Is not required to put a loop to check element is present from begin to end

no it simply finds if the element is present in the map or not
it returns the end of container if the pre is not found
else it returns a pointer to that key

so if
s.find(pre) == s.end()
then key ( pre ) is absent
else
returns reference to pre

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.