Pergunta de entrevista da empresa Perforce Software

Backtracking problem statement to solve.