You are given an integer, array nums, where exactly half of the elements are even, and the other half are odd.
Rearrange nums such that:
All even numbers are placed at even indexes
All odd numbers are placed at odd indexes
You may return any valid arrangement that satisfies these conditions.
Constraints:
nums.length
nums.length is even.
Half of the integers in nums are even.
nums[i]
You are given an integer, array nums, where exactly half of the elements are even, and the other half are odd.
Rearrange nums such that:
All even numbers are placed at even indexes
All odd numbers are placed at odd indexes
You may return any valid arrangement that satisfies these conditions.
Constraints:
nums.length
nums.length is even.
Half of the integers in nums are even.
nums[i]