Problem 2840 · Medium

Check if Strings Can be Made Equal With Operations II

Swaps two positions apart never move a letter across parity, so compare sorted letters within the even and odd positions.

Open the interactive visualisation