Maximum Number of Balloons
EasyStringshashing
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
You have a string text of lowercase letters and want to spell the word "balloon" as many times as possible.
Each character of text can be used at most once across all copies. Return the maximum number of complete "balloon" words you can form.
Examples
Input: text = "nlaebolko"
Output: 1
The letters b, a, l, l, o, o, n are all present once.
Input: text = "loonbalxballpoon"
Output: 2
There are enough letters for two copies.
Input: text = "leetcode"
Output: 0
There is no `b`.
Constraints
- 1 <= text.length <= 10^4
- `text` consists of lowercase English letters only
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.