if(pre == 0 or s.find(pre) != s.end()){
return true;
}
in line 11 0f this code
pre will never have 0.
then how the subarry sum will 0.
Unordered set, hashing
@souravrao3110
how?
it depends upon the elements present in array.
2, -3, 1, 2
here at index=2, pre=0.
I hope same was your doubt.
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.