Pregunta de entrevista de Microsoft

They have asked me coding question based on recursion and backtracking it was medium level question