Problem 3216 · Easy

Lexicographically Smallest String After a Swap

Swap the first adjacent pair of same-parity digits that is out of order, since an earlier position matters most.

Open the interactive visualisation