当前位置:网站首页>Daily question 1189 Maximum number of "balloons"
Daily question 1189 Maximum number of "balloons"
2022-07-05 06:12:00 【A big pigeon】
topic :
Give you a string text, You need to use text To piece together as many words as possible "balloon"( balloon ).
character string text Each letter in can only be used once at most . Please return the maximum number of words you can piece together "balloon".
Explain : Count , The number of words is determined by the minimum number of letters .( Barrel effect )
class Solution:
def maxNumberOfBalloons(self, text: str) -> int:
cnt = Counter(text)
return min(cnt["b"],cnt["a"],cnt["l"]//2,cnt["o"]//2,cnt["n"])
边栏推荐
- 2022年贵州省职业院校技能大赛中职组网络安全赛项规程
- Solution to game 10 of the personal field
- [cloud native] record of feign custom configuration of microservices
- Dynamic planning solution ideas and summary (30000 words)
- 【Rust 笔记】16-输入与输出(上)
- js快速将json数据转换为url参数
- MIT-6874-Deep Learning in the Life Sciences Week 7
- Implement a fixed capacity stack
- Data visualization chart summary (I)
- 【Rust 笔记】14-集合(上)
猜你喜欢
Doing SQL performance optimization is really eye-catching
Individual game 12
leetcode-6108:解密消息
API related to TCP connection
Leetcode-6110: number of incremental paths in the grid graph
[jailhouse article] jailhouse hypervisor
1.14 - 流水线
Dynamic planning solution ideas and summary (30000 words)
Overview of variable resistors - structure, operation and different applications
Traditional databases are gradually "difficult to adapt", and cloud native databases stand out
随机推荐
【Rust 笔记】14-集合(下)
Leetcode-9: palindromes
Erreur de connexion Navicat à la base de données Oracle Ora - 28547 ou Ora - 03135
[jailhouse article] performance measurements for hypervisors on embedded ARM processors
1039 Course List for Student
MatrixDB v4.5.0 重磅发布,全新推出 MARS2 存储引擎!
Simply sort out the types of sockets
RGB LED infinite mirror controlled by Arduino
7. Processing the input of multidimensional features
Collection: programming related websites and books
Wazuh开源主机安全解决方案的简介与使用体验
Multi screen computer screenshots will cut off multiple screens, not only the current screen
Full Permutation Code (recursive writing)
Sword finger offer II 058: schedule
Sqlmap tutorial (II) practical skills I
A reason that is easy to be ignored when the printer is offline
Smart construction site "hydropower energy consumption online monitoring system"
Matrixdb V4.5.0 was launched with a new mars2 storage engine!
【Rust 笔记】14-集合(上)
1.15 - 输入输出系统