Practice Find Subarrays With Equal Sum
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Given a 0-indexed integer array nums, determine whether there exist two subarrays of length 2 with equal sum. Note that the two subarrays must begin at different indices. Return true if these subarrays exist, and false otherwise. A subarray is a contiguous non-empty sequence of elements within an array.
Source: Find Subarrays With Equal Sum on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
nums = [4,2,4]
Output
true
# Example 2
Input
nums = [1,2,3,4,5]
Output
false
# Example 3
Input
nums = [0,0,0]
Output
true
Constraints
2 <= nums.length <= 1000
-10^9 <= nums[i] <= 10^9
Related LeetCode Problems
Practice more problems similar to Find Subarrays With Equal Sum.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.