In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article is to share with you about how to solve the problem of loving angry bookstore owners in leetcode. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
I. the content of the topic
The bookstore owner has a store that plans to open for customers.length minutes on a trial basis. Every minute some customers (customers [I]) enter the bookstore, and all of these customers leave at the end of that minute.
At some point, the bookstore owner gets angry. If the bookstore owner is angry at the first minute, then grumpy [I] = 1, otherwise grumpy [I] = 0. When the bookstore owner is angry, the customers in that minute will be dissatisfied, and if they are not angry, they will be satisfied.
Bookstore owners know a secret trick that can restrain their emotions and keep them from getting angry for X minutes, but they can only use it once.
Please return to this day of business, the maximum number of customers can be satisfied with the quantity.
Example:
Input: customers = [1recovery1jinjin2jiny1jiny5], grumpy = [0rectory1jin0jing1re0jing1jin0jin1], X = 3
Output: 16
Explanation:
The bookstore owner kept calm in the last three minutes.
The maximum number of satisfied customers = 1 + 1 + 1 + 1 + 7 + 5 = 16.
Tip:
one
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.