Backtracking isssue

SHouldn’t the backtracking step be done inside the for loop.