Sort Adjacent Pairs

Given an integer array nums, sort every adjacent, non-overlapping pair in nondecreasing order: (nums[0], nums[1]), (nums[2], nums[3]), and so on.

If the array length is odd, the final unpai...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: