{"id":"buddy-strings-cross-match-invariant","text":"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.","truth_value":"IN","source":"entries/2026/06/06/buddy-strings-solution.md","source_url":"","source_hash":"","justifications":[],"dependents":[],"metadata":{},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"buddy-strings-cross-match-invariant","truth_value":"IN","reason":"premise"}]}}