In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.