Domanda di colloquio di JPMorganChase

Questions about string and some simple greedy algorithm