Perforce Software interview question

Backtracking problem statement to solve.