Domanda di colloquio di Meta

A dynamic programming question about differences in words.