visit-before-enqueue-prevents-duplicates

Status: IN

In `matrix-cells-in-distance-order/solution.py`, marking cells as visited at enqueue time (not dequeue time) ensures each cell enters the queue at most once, preventing duplicate work and incorrect output.

Source: entries/2026/06/06/matrix-cells-in-distance-order-solution.md

JSON