Pregunta de entrevista de JPMorganChase

Questions about string and some simple greedy algorithm