Pergunta de entrevista da empresa Goodnotes

A string manipulation problem and generate random word under certain rules