#include "partition.h"
#include <bits/stdc++.h>
using namespace std;
const int N=3e7+1;
vector<int> solve(vector<int> A) {
    bool b[N];
    for (int i=0; i<N; i++) {
        b[i] = false;
    }
    vector<int> cur1, cur2, v;
    for (auto it : A) {
        if (b[it]) {
            b[it] = false;
            cur1.push_back(it);
        }else {
            b[it] = true;
            cur2.push_back(it);
        }
    }
    for (auto it : cur2)  v.push_back(it);
    for (auto it: cur1) v.push_back(it);
    return v;
}
