#3692

Majority Frequency Characters

pupil · 330 · lc easy +22 · 67.1% accepted · 51 likes · top 73%

Description

A lowercase string s is given. Group characters by their occurrence count: the frequency group for value k contains all characters appearing exactly k times. Find the group with the most distinct characters; break ties by choosing the group with the higher frequency k. Return its characters in any order.

Code

1
2
3