Tap here to switch tabs
Problem
Submissions

Problem: Split Array with Equal Sum

Try to solve the Split Array with Equal Sum problem.

Statement

Given an integer array nums of length n, return true if there exists a triplet of indices (i, j, k) satisfying 0<0 < i and i +1<+ 1 < j and j +1<+ 1 < k <n−1< n - 1 such that the sums of the following four subarrays are equal:

  • The sum of elements from index 00 to index i −1- 1

  • The sum of elements from index i +1+ 1 to index j −1- 1

  • The sum of elements from index j +1+ 1 to index k −1- 1

  • The sum of elements from index k +1+ 1 to index n −1- 1

Return false if no such triplet exists.

Constraints:

  • n == nums.length

  • 1≤1 \leq n ≤2000\leq 2000

  • −106≤-10^6 \leq nums[i] ≤106\leq 10^6

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Split Array with Equal Sum

Try to solve the Split Array with Equal Sum problem.

Statement

Given an integer array nums of length n, return true if there exists a triplet of indices (i, j, k) satisfying 0<0 < i and i +1<+ 1 < j and j +1<+ 1 < k <n−1< n - 1 such that the sums of the following four subarrays are equal:

  • The sum of elements from index 00 to index i −1- 1

  • The sum of elements from index i +1+ 1 to index j −1- 1

  • The sum of elements from index j +1+ 1 to index k −1- 1

  • The sum of elements from index k +1+ 1 to index n −1- 1

Return false if no such triplet exists.

Constraints:

  • n == nums.length

  • 1≤1 \leq n ≤2000\leq 2000

  • −106≤-10^6 \leq nums[i] ≤106\leq 10^6