**Problem Statement:**
Given the required input arguments, write an efficient algorithm to solve the **Sort Array By Parity** problem. Implement the required logic as specified by standard definitions for this classic algorithmic challenge.
**Hint / Expected Approach:**
Two-pointer partition (evens left, odds right)
**Edge Cases to Consider:**
- (1) All evens
- (2) All odds
- (3) Already partitioned
Examples
Example 1
Input:[3,1,2,4]
Output:Any arrangement where evens precede odds, e.g. [2,4,3,1]