You are given an integer array nums of even length.
Alice and Bob play a game with nums and an initially empty array arr. The game continues until nums is empty, where in each round:
Alice removes the smallest element currently in nums.
Bob then removes the smallest element from the remaining elements in nums.
Bob appends his removed element to arr.
Alice appends her removed element to arr.
Return the resulting array arr.
Constraints:
nums.length
nums[i]
nums.length
You are given an integer array nums of even length.
Alice and Bob play a game with nums and an initially empty array arr. The game continues until nums is empty, where in each round:
Alice removes the smallest element currently in nums.
Bob then removes the smallest element from the remaining elements in nums.
Bob appends his removed element to arr.
Alice appends her removed element to arr.
Return the resulting array arr.
Constraints:
nums.length
nums[i]
nums.length