Pick the fix
Your search finds 'ABA' in a 1 × 2 grid 'AB'. What is wrong?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A A cell is reused; mark cells as used while they are on the current path
Right: 'ABA' would need the first A twice.
The used mark must last exactly as long as the cell is on the current path, which is why it is undone on the way back.
Why not the others?
- B The grid is too small to search. Small grids are searched the same way.
- C Diagonal moves are missing. Diagonals are not allowed and would not help here.