ba-substring-equivalence

Status: IN

`"ba" not in s` is equivalent to "every 'a' precedes every 'b'" when the input contains only 'a' and 'b' — the only way to violate the ordering is a b-to-a transition, which is exactly the substring "ba".

Source: entries/2026/06/06/check-if-all-as-appears-before-all-bs-solution.md

JSON