Problems
Contests
Account
Problems
> Pairwise Swap > Editorial
Pairwise Swap — Solution & Editorial
Back to the Problem
Iterate in steps of two and swap in a mutable buffer.
Complexity:
O(|S|)
×
Refer Job