1
# Runtime: 668 ms (Top 23.61%) | Memory: 21 MB (Top 37.82%)
2
class Solution:
3
def canThreePartsEqualSum(self, arr: List[int]) -> bool:
4
total = sum(arr)
5
if total % 3 != 0:
6
return False
7
ave = total // 3
8
stage = 0
9
add = 0
10
for i in arr[:-1]:
11
add += i
12
if add == ave:
13
stage += 1
14
add = 0
15
if stage == 2:
16
return True
17
return False

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0