FunctionRacerProblemsRace

Maximum Number of Balloons

EasyHash mapsPython, JavaScript, TypeScript, Java, C++

You may use each character of text at most once. Return the largest number of times you can spell the word balloon using those characters.

Example 1

text "nlaebolko"
returns 1

There is enough for one balloon only.

Example 2

text "loonbalxballpoon"
returns 2

Enough for two.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Hash maps problems