$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · medium · #329

What goes in the blank?

# permutations by backtracking
for x in choices:
    if x in path:
        continue
    path.append(x)
    dfs(path)
    path.____()  # undo the choice

Answer: pop (also accepted: pop)

Backtracking undoes each choice after exploring it, so the shared path is clean for the next sibling.
Play Problem Solving ▸