Pregunta de entrevista de Neural Concept

backtracking problem from leet code