Two pointer  || 100%  || Java
Don\'t forget to upvote\n****\n\n# Code\n\nclass Solution {\n    public int[] sortArrayByParity(int[] nums) {\n        int[] n = new int[nums.length];\n        
**Don\'t forget to upvote**\n****\n\n# Code\n```\nclass Solution {\n    public int[] sortArrayByParity(int[] nums) {\n        int[] n = new int[nums.length];\n        int l = 0;\n        int r = nums.length-1;\n        for(int i=0;i<nums.length;i++){\n            if(nums[i]%2==0)\n                n[l++] = nums[i];\n            else\n                n[r--] = nums[i];\n        }\n        return n;\n    }\n}\n```
['Java']