Accepted Solution | Easy to understand | With Comments | Using unordered set (Hash set in Java)
\nclass Solution {\npublic:\n    bool findSubarrays(vector<int>& nums) {\n        int n = nums.size();\n        unordered_set<int> st; //Hash set for storing su
```\nclass Solution {\npublic:\n    bool findSubarrays(vector<int>& nums) {\n        int n = nums.size();\n        unordered_set<int> st; //Hash set for storing sum of subarray of length 2 \n        \n        for(int i=0;i<n-1;i++){\n            int sum = nums[i]+nums[i+1]; //storing the sum of subarray of length 2\n            \n            //check if the hash set isn\'t empty and contains the sum i.e. there exists a subarray with equal sum\n            \n            //if yes, return true\n            if(!st.empty() && st.find(sum)!=st.end()){\n                return true;\n            }\n            \n            //if no, insert the sum into hash set and check for next subarray\n            st.insert(sum);\n        }\n        \n        //if no two subarrays have equal sum, return false;\n        return false;\n    }\n};\n```
['C']