If you've spent time on LeetCode or GeeksforGeeks, you've probably run into the classic "Rearrange Array Alternately" problem.
The premise: given a sorted array of positive integers, rearrange it so the first element is the maximum, the second is the minimum, the third is the second maximum, the fourth is the second minimum, and so on.
For [1, 2, 3, 4, 5], the expected output is [5, 1, 4, 2, 3].
The Standard Solutions
There are usually two approaches taught for this:






