분류 전체보기 48

[LeetCode] Minimum Deletions to Make Character Frequencies Unique

Problem Solution Make a dictionary of all appearing alphabets and their frequencies. Make a set of unique frequencies. Go through the dictionary and check if the frequency for this character already exists in the set. If it is, decrement the frequency until it is unique or reaches zero. Increment the counter at the same time. Add the frequency to the set. My code exceeded the time limit at first..