#1052
Grumpy Bookstore Owner
specialist · 655 · lc medium +30 · 64% accepted · 2,697 likes · top 67%
Description
A bookstore owner is grumpy (grumpy[i] == 1) during some minutes, making that minute's customers unsatisfied. Using a special technique, the owner can suppress grumpiness for exactly minutes consecutive minutes (used at most once).
Given customers and grumpy arrays and the integer minutes, return the maximum number of customers who can be satisfied.
Code
1
2
3