class Solution(object): def getMaxByCount(self,A,maxlen): curmax = 0 curmax = sum(A[:maxlen]) bigmax = curmax n = len(A) for i in range(maxlen,n): curmax = curmax-A[i-maxlen]+A[i] if curmax > bigmax: bigmax = curmax return bigmax def maxSumTwoNoOverl…