Pregunta de entrevista de Salesforce

Josephus problem Sort string by frequency of characters