python-negative-mod-safe-for-circular

Status: IN

Python's `%` operator guarantees non-negative results for positive divisors, so `(i - j) % n` correctly handles backward circular wrapping without an explicit bounds check — used in defuse-the-bomb and applicable to all circular-array solutions.

Source: entries/2026/06/06/defuse-the-bomb-solution.md

JSON