Question d’entretien chez TikTok

Dynamic programming question found on leetcode