Tap here to switch tabs
Problem
Submissions

Problem: Partition Array Into Three Parts With Equal Sum

Try to solve the Partition Array Into Three Parts With Equal Sum problem.

Statement

Given an array of integers arr, return true if the array can be partitioned into 33 non empty contiguous parts with equal sums, and false otherwise.

Formally, the array can be partitioned if there exist indices i and j with i+1<ji + 1 < j such that:
(arr[00] + arr[11] + …\dots + arr[i]) = (arr[i + 11] + arr[i + 22] + …\dots + arr[j - 11]) = (arr[j + 11] + …\dots + arr[arr.length - 11])

Constraints:

  • 3≤3 \leq arr.length ≤5×104\leq 5 \times 10^4

  • −104≤-10^4 \leq arr[i] ≤104\leq 10^4

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Partition Array Into Three Parts With Equal Sum

Try to solve the Partition Array Into Three Parts With Equal Sum problem.

Statement

Given an array of integers arr, return true if the array can be partitioned into 33 non empty contiguous parts with equal sums, and false otherwise.

Formally, the array can be partitioned if there exist indices i and j with i+1<ji + 1 < j such that:
(arr[00] + arr[11] + …\dots + arr[i]) = (arr[i + 11] + arr[i + 22] + …\dots + arr[j - 11]) = (arr[j + 11] + …\dots + arr[arr.length - 11])

Constraints:

  • 3≤3 \leq arr.length ≤5×104\leq 5 \times 10^4

  • −104≤-10^4 \leq arr[i] ≤104\leq 10^4