⭐ Beginner Friendly || Explained || 1ms
\n/*\n\nApproach:\n\nNeed to find contiguous subarrays of length 2 only with different indices \nso simply traverse array from i=0 to n-2\n\nand on every iterat
```\n/*\n\nApproach:\n\nNeed to find contiguous subarrays of length 2 only with different indices \nso simply traverse array from i=0 to n-2\n\nand on every iteration check whether the sum of\npairs nums[i]+nums[i+1] exists in the set or not\n\nIf exists then return true as two subarrays are found here\nbut if the iteration completes then return false\n\n*/\nclass Solution {\n    public boolean findSubarrays(int[] nums) {\n        int len = nums.length;\n        if(len<=2) return false;\n        \n        Set<Integer> set = new HashSet<>();\n        for(int i=0; i<len-1; i++){\n            int sum = nums[i]+nums[i+1];\n            if(set.contains(sum)) return true;\n            set.add(sum);\n        }\n        \n        return false;\n    }\n}\n```
['Java']