Brute and Optimized
Only sum of two is asked so in single iteratin if any subarray (contiguous) has same sum then there exist, thus return true.\n\n\n# Code\njava []\nclass Solutio
Only sum of two is asked so in single iteratin if any subarray (contiguous) has same sum then there exist, thus return true.\n\n\n# Code\n```java []\nclass Solution {\n    public boolean findSubarrays(int[] nums) {\n        int n = nums.length;\n        int count = 0;\n        \n        for (int i = 0; i < n - 1; i++) {\n            for (int j = i + 1; j < n - 1; j++) {\n                if (nums[j] + nums[j + 1] == nums[i] + nums[i + 1]) {\n                    count++;\n                }\n            }\n        }\n        return count >= 1;\n    }\n}\n\n//O(n^2)\n//O(1)\n```\n```java []\nclass Solution {\n    public boolean findSubarrays(int[] nums) {\n        int n = nums.length;\n        HashMap<Integer, Integer> map = new HashMap<>();\n        \n        for (int i = 1; i < n; i++) {\n            int sum = nums[i] + nums[i - 1];\n            map.put(sum, map.getOrDefault(sum, 0) + 1);\n            if (map.get(sum) > 1) {\n                return true;\n            }\n        }\n        return false;\n    }\n}\n\n//O(N)\n//O(N)\n```\n```java []\nclass Solution {\n    public boolean findSubarrays(int[] nums) {\n        int n = nums.length;\n        HashSet<Integer> hs = new HashSet<>();\n        \n       for(int i=1;i<n;i++){\n            int sum = nums[i]+ nums[i-1];\n            if(hs.contains(sum)) return true;\n            hs.add(sum);\n       }\n       return false;\n    }\n}\n//O(N)\n//O(N)\n\n```
['Java']