Ctrl K

Balloon Signs From Letters

Easy
A party store orders signs that spell the word balloon. The warehouse holds plastic letters, listed in the string letters: each character is one letter. Each letter can go into only one sign. How many complete balloon signs can be assembled?
Example 1
letters="nobleballoonlo" → 1

There are two b, four l, four o and two n, but only one a, so just one sign can be made.

Example 2
letters="llooaabbnnoolloo" → 2

Every letter is enough for two signs: two each of b, a, n, four l and six o.

Example 3
letters="blown" → 0

There is no a, so not even one sign can be made.

Constraints
  • 0 ≤ len(letters) ≤ 2000
  • letters consists of lowercase English letters
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsNote From Clipped Letters EasyFirst One-Off Letter EasyWords Heard Only Once EasyWords From Letter Tiles EasyLetters Up and Down Easy
loading Python…
Input
letters="nobleballoonlo"
Expected
1

Run checks the first 3 tests in your browser. Submit checks all 120 tests on the server, hidden ones included.