Simple solution using map with intuition and code (with comments)
We have to find whether there exist two subarray of length 2 with equal sum. \nNote: number should be at different indices\n\nObservation:\nTo find the given su
We have to find whether there exist two subarray of length 2 with equal sum. \nNote: number should be at different indices\n\nObservation:\nTo find the given subarray sum present or not, we have to store it to check and return true or false. \nSo we use unordered_map(hashmap) to store it and check in map that the current sum is already present or not. If it is present return true, else return false.\n\nCode:\n\n```\nclass Solution {\npublic:\n    bool findSubarrays(vector<int>& nums) {\n        unordered_map<int,int> mp;        //creating hashmap\n        for(int i=0;i<nums.size()-1;i++){  //iterating till n-1\n            int sum=nums[i]+nums[i+1];\n            mp[sum]++;\n            if(mp[sum]>1)                  //check if sum is present or not\n                return true;               //if present return true\n        }\n        return false;                      //else return false\n    }\n};\n```\n\nTC: O(N) for iterating whole array\nSC: O(N) for unordered_map\nwhere N is size of num array
['C']