Just we need is total count of each char of balloon in the string,
Note dividing by 2 in l&O is due to its 2 times occurence so if its 1 time(1//2 =0) so simply min would be 0 so no instance
tex=Counter(text)
return min(tex['b'],tex['a'],tex['l']//2,tex['o']//2,tex['n'])
And for one who dont know counter its just work like a dictionary so you if you were not knowing this simply run loop and create a dictionary and store occ of all char which is same as doing counter
So, well predictable space complexity O(26)
and timeO(n)
If it helped you upvote please😄