100% t.c. short solution. easy to undesrtand
\nPLEASE UPVOTE IF YOU LIKE.\n\n        int[] ans = new int[nums.length];\n        int even = -2, odd = -1;\n\n        for (int  i: nums){\n            if (i % 
```\nPLEASE UPVOTE IF YOU LIKE.\n```\n        int[] ans = new int[nums.length];\n        int even = -2, odd = -1;\n\n        for (int  i: nums){\n            if (i % 2 == 0) ans[even+=2] = i;\n            else ans[odd+=2] = i;\n        }\n\n        return ans;
['Java']