85ms Java Solution but Easy to Understand
\nclass Solution {\n    public int[] sortArrayByParityII(int[] A) {\n        \n        List<Integer> even = new ArrayList<>();\n        List<Integer> odd = new 
```\nclass Solution {\n    public int[] sortArrayByParityII(int[] A) {\n        \n        List<Integer> even = new ArrayList<>();\n        List<Integer> odd = new ArrayList<>();\n        \n        for (int n : A) {\n            if (n % 2 == 0)\n                even.add(n);\n            else \n                odd.add(n);\n        }\n        int[] result = new int[A.length];\n        for (int i = 0; i < A.length; i++) {\n            if (i % 2 == 0) {\n                result[i] = even.remove(0);\n            } else {\n                result[i] = odd.remove(0);\n            }\n        }\n        return result;\n    }\n}\n```
[]