c++(12ms 98%) two pointers, in place
Runtime: 12 ms, faster than 98.13% of C++ online submissions for Sort Array By Parity II.\nMemory Usage: 21.5 MB, less than 29.09% of C++ online submissions for
Runtime: 12 ms, faster than 98.13% of C++ online submissions for Sort Array By Parity II.\nMemory Usage: 21.5 MB, less than 29.09% of C++ online submissions for Sort Array By Parity II.\n```\nclass Solution {\npublic:\n  vector<int> sortArrayByParityII(vector<int>& A) {\n    int i = 0, ni = A.size(), j = 1, nj = A.size() + 1;\n    \n    while(true){\n      while(i != ni && A[i]%2 == 0) i+=2;\n      while(j != nj && A[j]%2 == 1) j+=2;\n      if(i == ni) break;\n      swap(A[i],A[j]);\n    }\n    return A;\n  }\n};\n```
['C', 'C++']