May #LeetCoding Challenge #Day22 #Sort Characters By Frequency

    May LeetCoding Challenge[Day22] - Sort Characters By Frequency

    Given a string, sort it in decreasing order based on the frequency of characters. Input: "tree" Output: "eert" Explanation: 'e' appears twice while 'r' and 't' both appear once. So 'e' must appear before both 'r' and 't'. Therefore "eetr" is also a valid answer. 1. 알고리즘을 해결하기 위해서 생각한 방법 - 우선, 정말 단순하게 생각했다. - 앞에서부터 counting을 하고, counting한 문자에 대한 max를 찾아서 하나씩 retunr하는 것이다. - t:1, r:1, e:2와 같이 map을..