Domanda di colloquio di Epic Games

Basic dynamic programming question, string question