Question d’entretien chez TikTok

Medium Hackerrank question, dynamic programming.