Domanda di colloquio di Scale

Dynamic programming question, regex question, and another one I forgot.