class Solution:
def maxSatisfied(self, customers: List[int], grumpy: List[int], minutes: int) -> int:
satisfiedCustomers = 0
unSatisfied = []
n = len(customers) for i in range(n):
if not grumpy[i]:
satisfiedCustomers += customers[i]
unSatisfied.append(0)
else:
unSatisfied.append(customers[i]) maxValue = float("-inf")
for i in range(n - minutes + 1):
s = sum(unSatisfied[i:i + minutes])
if s > maxValue:
maxValue = s return satisfiedCustomers + maxValue