708. Sort Characters by Frequency
Given a string `S`, arrange its characters in descending order based on their frequency. The frequency of a character is the number of times it appears in the string. Output the sorted string. ***Note: If two characters have the same frequency, sort them in lexicographical order.***
A single line containing a string S.
Print the sorted string.
1 <= s.length <= 10^5 S consists of uppercase and lowercase English letters and digits.