You are given a nums. Rearrange the elements of nums according to the following rules:
Sort the values present at odd indices in descending order.
Sort the values present at even indices in ascending order.
Return the modified array nums after applying these rearrangements.
Constraints:
nums.length
nums[i]
You are given a nums. Rearrange the elements of nums according to the following rules:
Sort the values present at odd indices in descending order.
Sort the values present at even indices in ascending order.
Return the modified array nums after applying these rearrangements.
Constraints:
nums.length
nums[i]