About the implementation of subarray sum=0

what is unordered set and in the video within the bool function in the if statement the condition s.find(pre)!=s.end() what does it mean

@aslesha.j7

hello Aslesha,
s.find(pre) !=s.end()

here we are checking whether pre is present in set s or not.
if s.find(pre)==s.end() it means pre is not present in the set otherwise it is present

s.find(pre) suppose give us 0 therefore we are comparing 0 with s.end() hence if 0==s.end() it means we have found the element before reaching end?

yeah u can think in that way as well.
that if s.find(pre)!=s.end() means we have found pre before reaching s.end().
if s.find(pre)==s.end() means we have reached s.end() but have not found pre.

what is unordered set

An unordered_set is implemented using a hash table.
In this, all the elements are unique i.e. when you try to insert a element which is already existing then it will not be inserted.
@aslesha.j7 do u have any specific confusion regarding it?

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.