Pregunta de entrevista de X

4 hard problems, probably leetcode dp, can't remember exactly