Domanda di colloquio di Goodnotes

A string manipulation problem and generate random word under certain rules