Solution: Sort Array By Parity II
Solution: Sort Array By Parity II asks you to rearrange an array with equal numbers of even and odd values so even values occupy even positions and odd values occupy odd positions.
We'll cover the following...
We'll cover the following...
Statement
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
...