Given a string s, sort its characters by decreasing frequency and return the result. Characters with equal frequency appear in ascending character order (so the output is deterministic).
Input: one line, the string s.
Output: the frequency-sorted string.
tree
eert
'e' twice, then 'r' and 't' (tie → ascending).
cccaaa
aaaccc
Tie at 3 — 'a' before 'c'.
Run your code against the sample tests, or Submit to run the full suite.