Sort Array by Parity

Requirements:

Given an integer array nums, move all the even integers at the beginning of the array followed by all the odd integers. The values should be in increasing order.

Example 1:

There are three even values and three odd values, already in increasing order. We should move [2,4,6] to the front, followed by [1,2,3].

Example 2:

The algorithm shouldn't break in this case of only one even value and no odd values, returning the same as the input.

Example 3:

There are six even values and no odd values. The algorithm should sort the array.

nums:

Please try and complete this project before viewing the solution.