Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 908 Bytes

_2395. Find Subarrays With Equal Sum.md

File metadata and controls

41 lines (27 loc) · 908 Bytes

All prompts are owned by LeetCode. To view the prompt, click the title link above.

Back to top


First completed : May 31, 2024

Last updated : July 01, 2024


Related Topics : Array, Hash Table

Acceptance Rate : 65.201 %


Solutions

Python

class Solution:
    def findSubarrays(self, nums: List[int]) -> bool:
        sumsSet = set()

        for i in range(0, len(nums) - 1) :
            sum = nums[i] + nums[i + 1]
            
            if (sum in sumsSet) :
                return True
            
            sumsSet.add(sum)
        
        return False