CHECK SUB-ARRAY SUM

Why can’t we simple use the condition if(pre==0) while returning true?
What is the need of s.find()!=end()?

hello @mverma_be19
we have two cases .
a) our pre is 0
b) pre is already there in the map.
for example-
array -> 1 -1 1
pre -> 1 0 1
here if u see second 1 of pre array then u will find that it is already occured before right?
that means elements between those two 1 have zero some because then only it is possible
1 + something = 1 when something is 0.

that is why we have that other condition as well