1# Runtime: 668 ms (Top 23.61%) | Memory: 21 MB (Top 37.82%)2class Solution:3def canThreePartsEqualSum(self, arr: List[int]) -> bool:4total = sum(arr)5if total % 3 != 0:6return False7ave = total // 38stage = 09add = 010for i in arr[:-1]:11add += i12if add == ave:13stage += 114add = 015if stage == 2:16return True17return False