Salesforce Interview Question

Josephus problem Sort string by frequency of characters