class Solution(object): def canThreePartsEqualSum(self, A: 'List[int]') -> bool: n = len(A) sums = sum(A) if sums % 3 != 0: return False target = sums // 3 leftpart = 0 leftboundary = n -1 for i in range(n-2): leftpart += A[i] if leftpart == target:…