Character Frequency Sort

Sort a string by the frequency of each character.

Easy5/15/2024

Problem statement

Given a lowercase string, return a new string sorted by the frequency of each character in descending order, followed by the characters in alphabetical order if frequencies are the same.

Example: For mississippi the output should be iiiissssppm

Problem leaderboard

#
Size
%
Users
#1
75 c.
Top 20%
voytxt
#2
82 c.
Top 40%
CorentinTh
#3
87 c.
Top 60%
maximec-indy
#4
88 c.
Top 80%
Thomasdcrt
#5
174 c.
Top 100%
emma