Can You Detect the Word Balloon? (LeetCode 1189: Maximum Number of Balloons)

preview_player
Показать описание
In this video I explain and show you how to code the solution for the LeetCode 1189: Maximum Number of Balloons problem in JavaScript in the easiest way possible and while getting an optimal time complexity, I fully explain each step and each part of the code, trace and visualize the algorithm to make sure you fully understand how to solve this leetcode problem.

lets code it together.

Time Stamps🕒:
00:00 Explanation & Visualization
03:17 Code

#leetcode #coding #programming
Рекомендации по теме
Комментарии
Автор

I found your channel through recommendations. I applaud your effort in visualizing the entire logic. Perhaps might dive into LeetCode someday for the fun of it!

toooplive
Автор

I'm new to DSA and to leetcode, but would this be a good problem for a heap? create 5 nodes, one for each unique letter, and loop through the string. Each time you get b, a, or n, increment the respective node by 2, and each time you get l or o, increment by one. That way, when you look at the top node in the minimum heap, that letter will have the minimum number of repetitions and will decide how many times you can form "balloon" (and that's why letters b, a, and n would get incremented by 2)

PaintHim