check consecutive sum (~43ms)
Since the condition is to check for subarray of length two, we only hav to check for the sum of two elements which are nums[i] and nums[i+1].\n\n_For this solut
Since the condition is to check for subarray of length two, we only hav to check for the sum of two elements which are `nums[i]` and `nums[i+1]`.\n\n_For this solution we use the `set()` data structure for memorizing the previous sums.If the subarray exists, then we stop the loop and return `True`._\n\n```\nclass Solution:\n    def findSubarrays(self, nums: List[int]) -> bool:\n        out = set()\n        for i in range(1, len(nums)):\n            if nums[i-1]+nums[i] in out:\n                return True\n            out.add(nums[i-1]+nums[i])\n        return False\n```\n\n![image](https://assets.leetcode.com/users/images/92c8292f-2afe-415a-a168-7cf0c7328d10_1664350114.1230812.png)
['Python']