Skip to content

Practice Maximum Number of Balloons

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Easy#1189
LeetCode Problem

Maximum Number of Balloons

Problem Statement

Given a string text, you want to use the characters of text to form as many instances of the word "balloon" as possible. You can use each character in text at most once. Return the maximum number of instances that can be formed. Example 1: Example 2: Example 3: Constraints: Note: This question is the same as 2287: Rearrange Characters to Make Target String.

Source: Maximum Number of Balloons on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
text = "nlaebolko"
Output
1

# Example 2

Input
text = "loonbalxballpoon"
Output
2

# Example 3

Input
text = "leetcode"
Output
0

Constraints

1 <= text.length <= 10^4
text consists of lower case English letters only.

Related LeetCode Problems

Practice more problems similar to Maximum Number of Balloons.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.