Challenge: Rearrange Sorted List in Max/Min Form
Try to solve the Rearrange Sorted List in Max/Min Form problem.
We'll cover the following
Statement
We're given a sorted list, nums
, containing positive integers only. We have to rearrange the list so that when returned, the
In the end, we’ll have the largest remaining numbers in descending order and the smallest in ascending order at even and odd positions, respectively.
Constraints:
nums.length
nums[i]
Examples
Level up your interview prep. Join Educative to access 70+ hands-on prep courses.