Why is this solution not working for this Problem?

Why is this solution not working for this Problem?
https://practice.geeksforgeeks.org/problems/subarray-with-0-sum/0


Please tell me ASAP

@cbcao263 refer this
(https://www.geeksforgeeks.org/find-if-there-is-a-subarray-with-0-sum/)

I don’t understand this solution, Can You Please explain me about that.

@aryangrover just keep calculating the prefix sum if it is already present before or its 0 do cnt++

But in this one, I have just to print Yes but What if They asked about the number of subarrays, that’s why I used best approach.
Why this one’s not wotking?

@aryangrover what one?

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.