Java | Arrays | Easy Solution
\nclass Solution {\n    public int[] sortArrayByParity(int[] A) {\n        int[] ans = new int[A.length];\n        int t=0;\n        for (int i=0;i<A.length;++i
```\nclass Solution {\n    public int[] sortArrayByParity(int[] A) {\n        int[] ans = new int[A.length];\n        int t=0;\n        for (int i=0;i<A.length;++i)\n            if (A[i]%2==0)\n                ans[t++] = A[i];\n        for (int i=0;i<A.length;++i)\n            if (A[i]%2==1)\n                ans[t++] = A[i];\n        return ans;\n    }\n}\n```\nKindly upvote if you like the code.
['Array', 'Java']