Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Grumpy Bookstore Owner

A store owner is grumpy in some minutes (grumpy[i] = 1), making the customers of that minute unsatisfied. The owner can stay calm for one window of exactly m consecutive minutes. Print the maximum number of satisfied customers.

Constraints

1 <= m <= n <= 2 * 10^4

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.