Java | From 5ms to 2ms | 2 Solutions
\n# Solution 1 | 5ms | 15% Faster\n\nclass Solution {\n    public boolean findSubarrays(int[] nums) {\n        for (int i = 0; i < nums.length - 2; i++) {\n    
\n# Solution 1 | 5ms | 15% Faster\n```\nclass Solution {\n    public boolean findSubarrays(int[] nums) {\n        for (int i = 0; i < nums.length - 2; i++) {\n            for (int j = i + 1; j < nums.length - 1; j++) {\n                if (nums[i] + nums[i + 1] == nums[j] + nums[j + 1]) {\n                    return true;\n                }\n            }\n        }\n        return false;\n    }\n}\n```\n\n# Solution 2 | 2ms | 80% Faster\n```\nclass Solution {\n    public boolean findSubarrays(int[] nums) {\n        int temp = nums[0];\n        Set<Integer> set = new HashSet<>();\n        for (int i = 1; i < nums.length; i++) {\n            int t = nums[i];\n            nums[i] += temp;\n            if (set.contains(nums[i])) {\n                return true;\n            } else {\n                set.add(nums[i]);\n            }\n            temp = t;\n        }\n        return false;\n    }\n}\n```
['Java']