当前位置:网站首页>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"])
边栏推荐
- Shutter web hardware keyboard monitoring
- [rust notes] 15 string and text (Part 1)
- Binary search template
- Daily question 2006 Number of pairs whose absolute value of difference is k
- Personal developed penetration testing tool Satania v1.2 update
- Leetcode-6110: number of incremental paths in the grid graph
- [rust notes] 17 concurrent (Part 2)
- Daily question 2013 Detect square
- Daily question 1984 Minimum difference in student scores
- Data visualization chart summary (I)
猜你喜欢
LVS简介【暂未完成(半成品)】
开源存储这么香,为何我们还要坚持自研?
LaMDA 不可能觉醒吗?
Leetcode-6110: number of incremental paths in the grid graph
全排列的代码 (递归写法)
Open source storage is so popular, why do we insist on self-development?
[jailhouse article] jailhouse hypervisor
Data visualization chart summary (II)
Wazuh开源主机安全解决方案的简介与使用体验
Analysis of backdoor vulnerability in remote code execution penetration test / / phpstudy of national game title of national secondary vocational network security B module
随机推荐
【Rust 笔记】15-字符串与文本(上)
【Rust 笔记】16-输入与输出(下)
1039 Course List for Student
The difference between CPU core and logical processor
【Rust 笔记】15-字符串与文本(下)
Règlement sur la sécurité des réseaux dans les écoles professionnelles secondaires du concours de compétences des écoles professionnelles de la province de Guizhou en 2022
Bit mask of bit operation
4. 对象映射 - Mapping.Mapster
【Rust 笔记】14-集合(上)
[practical skills] technical management of managers with non-technical background
中职网络安全技能竞赛——广西区赛中间件渗透测试教程文章
[cloud native] record of feign custom configuration of microservices
leetcode-6109:知道秘密的人数
leetcode-31:下一个排列
[jailhouse article] look mum, no VM exits
Leetcode-6110: number of incremental paths in the grid graph
Sword finger offer II 058: schedule
数据可视化图表总结(二)
1040 Longest Symmetric String
liunx启动redis