Back to DSA sheet
Maximum Number of Balloons
EasyArraysGiven a string of lowercase letters, return how many times you can form the word 'balloon' using its characters (each character used at most once).
Input format (stdin): a single line of text. Output the maximum count.
Examples
Input: nlaebolko
Output: 1
Exactly one 'balloon' can be built.
Input: loonbalxballpoon
Output: 2
Two copies can be built.
Constraints
- 1 <= length <= 10^4
- Lowercase English letters
Sheets
NeetCode 250
maximum-number-of-balloons.cpp3 sample tests
Loading editor
Test results
Run the sample tests to check your solution against expected output.
Custom input (stdin)
Output
Run your code to see its output.