Pergunta de entrevista da empresa TikTok

Dynamic programming question found on leetcode