Pregunta de entrevista de ByteDance

I think there was a dynamic programming question