Pregunta de entrevista de TikTok

Tree search and traversing problems , knapsack sometimes too