Question: Sort Characters by Frequency. Please use hash table, language doesn't matter. Given a string s , sort it in deceasing order based on the frequency
Sort Characters by Frequency. Please use hash table, language doesn't matter.
Given a string s , sort it in deceasing order based on the frequency of the characters. the frequency of a character is the number of times it appears in the string.
-- Example --
Input: s = "tree"
Output: "eert"
Explanation: e appears twice while r and t both appear once. So e must appear before both r and t.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
