Java - Faster than 100%
\nclass Solution {\n    public int[] sortArrayByParity(int[] A) {\n        int j = A.length - 1;\n        for (int i = 0; i < j; i++) {\n            if (A[i] % 
```\nclass Solution {\n    public int[] sortArrayByParity(int[] A) {\n        int j = A.length - 1;\n        for (int i = 0; i < j; i++) {\n            if (A[i] % 2 != 0) {\n                int t = A[i];\n                while(A[j] % 2 != 0 && j > i) {\n                    j--;\n                }\n                A[i] = A[j];\n                A[j] = t;\n                j--;\n            }\n        }\n        return A; \n    }\n}\n```\n\n\n![image](https://assets.leetcode.com/users/mariap/image_1576503902.png)\n\n
['Java']