2395. Find Subarrays With Equal Sum

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 2395

class Solution:
    def findSubarrays(self, nums: List[int]) -> bool:
        vis = set()
        for a, b in pairwise(nums):
            if (x := a + b) in vis:
                return True
            vis.add(x)
        return False