Leetcode 2164. Sort Even and Odd Indices Independently
Rearrange the array by sorting elements at even indices in non-decreasing order and elements at odd indices in non-increasing order, then placing the sorted values back into their original parity positions. Return the resulting array.
Asked at:
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Late November, 2024
Meta
Junior
Sort numbers based on whether they are odd or even
Hello Interview Premium
Your account is free and you can post anonymously if you choose.