buddy-strings-cross-match-invariant

Status: IN

The final correctness check requires that the two differing positions cross-match (`s[i] == goal[j]` and `s[j] == goal[i]`), not merely that they differ — this is the necessary and sufficient condition for a single-swap solution.

Source: entries/2026/06/06/buddy-strings-solution.md

JSON