Grokking Data Structures & Algorithms for Coding Interviews
Ask Author
Back to course home

0% completed

Vote For New Content
ABSOLUTELY HORRIBLE CODE IN THE SOLUTION

designgurus

Aug 19, 2025

The solution code is HORRENDOUS! why would you literally hardcode all 5 lines?

class Solution: def maxNumberOfBalloons(self, text: str) -> int: charFreq = Counter(text) word = 'balloon' wordCharFreq = Counter(word) result = sys.maxsize for char in set(word): result = min(result, charFreq[char] // wordCharFreq[char]) return result

0

0

Comments
Comments

On this page