$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · hard · #333

What goes in the blank?

# bitmask DP (travelling salesman): visit city v next
for v in range(n):
    if mask & (1 << v):
        continue  # already visited
    nmask = mask ____ (1 << v)
    dp[nmask][v] = min(dp[nmask][v], dp[mask][u] + w[u][v])

Answer: | (also accepted: |, ^, +)

OR sets bit v, adding city v to the visited set. Because the bit is known to be 0 here, ^ and + give the same result, but | is the idiom.
Play Problem Solving ▸