Pregunta de entrevista de TikTok

Backtracking and dynamic programming questions.