Question d’entretien chez TikTok

Dynamic programming (DP) and string manipulation Leetcode-style question.