当前位置:网站首页>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"])
边栏推荐
- 927. 三等分 模拟
- 多屏电脑截屏会把多屏连着截下来,而不是只截当前屏
- Leetcode-22: bracket generation
- Liunx starts redis
- Analysis of backdoor vulnerability in remote code execution penetration test / / phpstudy of national game title of national secondary vocational network security B module
- Sqlmap tutorial (1)
- LeetCode 1200.最小绝对差
- Daily question 1984 Minimum difference in student scores
- Typical use cases for knapsacks, queues, and stacks
- Simply sort out the types of sockets
猜你喜欢
Open source storage is so popular, why do we insist on self-development?
RGB LED infinite mirror controlled by Arduino
Matrixdb V4.5.0 was launched with a new mars2 storage engine!
Sqlmap tutorial (II) practical skills I
Smart construction site "hydropower energy consumption online monitoring system"
1.13 - RISC/CISC
做 SQL 性能优化真是让人干瞪眼
leetcode-6111:螺旋矩阵 IV
SQLMAP使用教程(一)
R language [import and export of dataset]
随机推荐
CPU内核和逻辑处理器的区别
SQLMAP使用教程(一)
927. Trisection simulation
Data visualization chart summary (I)
[rust notes] 17 concurrent (Part 1)
1.14 - 流水线
Simple knapsack, queue and stack with deque
JS quickly converts JSON data into URL parameters
【Rust 笔记】13-迭代器(下)
leetcode-6108:解密消息
[rust notes] 15 string and text (Part 1)
Introduction to LVS [unfinished (semi-finished products)]
2022 极术通讯-Arm 虚拟硬件加速物联网软件开发
MIT-6874-Deep Learning in the Life Sciences Week 7
Binary search template
leetcode-1200:最小绝对差
LeetCode 0107. Sequence traversal of binary tree II - another method
全排列的代码 (递归写法)
MIT-6874-Deep Learning in the Life Sciences Week 7
Navicat連接Oracle數據庫報錯ORA-28547或ORA-03135