Pregunta de entrevista de TikTok

Dynamic programming question found on leetcode