2395. Find Subarrays With Equal Sum

Обновлено: 2024-03-12
1 мин
[]

Содержание

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