Sum of subarrays is zero or not

In the above implementation using unordered set, how the time complexity is O(n) as we are iterating n times + there is find function of set also having some complexity.
Please explain…

@Divyakharb find function is o(1) so complexity is o(n)

i hope your doubt is cleared if yes dont forget to mark the doubt as resolved @Divyakharb :smiley:

How find function has complexity of O(1) please explain?

its like accessing h[x] which also is 0(1). find function is o(1) its is documentation @Divyakharb

@Divyakharb if your doubt is cleared please mark it as resolved