Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Given a string, sort it in decreasing order based on the frequency of characters.
- Example 1:
- 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.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement