Domanda di colloquio di Nielsen

Algorithm involving strings and how to work with it