class Solution:
def maxSatisfied(self, customers: List[int], grumpy: List[int], X: int) -> int:
A = sum(customers)
for i in range(len(customers)):
if grumpy[i] == 0:
customers[i] = 0
res = sum(customers[:X])
tmp = res
for i in range(len(customers) - X):
tmp = tmp - customers[i] + customers[i + X]
res = max(res , tmp)
return A + res - sum(customers)