int maxLen(vector<int>&A, int n)
{
// Your code here
unordered_map<long long ,int> uMap;
uMap.insert({0, 1});
int ans = 0 ;
long long currSum = 0;
for(int i = 0 ; i < n ; i++){
currSum += A[i];
if(uMap[currSum] > 0)
ans = max(ans, i - uMap[currSum] + 2);
else
uMap[currSum] = i + 2;
}
return ans;
}