Given a string s, determine the frequency of each unique character.
Group the distinct characters by their frequencies, where the size of each group is the number of distinct characters sharing that frequency.
Identify the group with the maximum size. If there is a tie between multiple frequency groups of the same maximum size, choose the group corresponding to the largest frequency.
Return a string containing all distinct characters in this chosen frequency group. The characters may be returned in any order.
Constraints:
s.length
s consists only of lowercase English letters.
Given a string s, determine the frequency of each unique character.
Group the distinct characters by their frequencies, where the size of each group is the number of distinct characters sharing that frequency.
Identify the group with the maximum size. If there is a tie between multiple frequency groups of the same maximum size, choose the group corresponding to the largest frequency.
Return a string containing all distinct characters in this chosen frequency group. The characters may be returned in any order.
Constraints:
s.length
s consists only of lowercase English letters.