Easiest Java (2 ms) beginner solution
\nclass Solution {\n    public int[] sortArrayByParity(int[] nums) {\n        int n= nums.length; \n        int[] arr = new int[n]; \n        int x=0;\n        
```\nclass Solution {\n    public int[] sortArrayByParity(int[] nums) {\n        int n= nums.length; \n        int[] arr = new int[n]; \n        int x=0;\n        for(int i=0;i<n;i++){\n            if(nums[i]%2==0){\n                arr[x]=nums[i];\n                x++;\n            }\n        }\n        for(int i=0;i<n;i++){\n            if(nums[i]%2!=0){\n                arr[x]=nums[i]; \n                x++;\n            }\n        }\n        return arr;\n    }\n}\n```
['Array', 'Sorting', 'Java']