#include "partition.h"
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
const int maxn = 2e5 + 10;
//vector < pair < int, int > > g;
int n, used[maxn];
std::vector<int> solve(std::vector<int> A)
{
    map < int, int > mp;
    n = A.size();
    for (int i = 0; i < n; ++ i)
        used[i] = 0;
    //g.clear();
    vector < int > ans;
    for (int i = 0; i < n; ++ i)
    {
        mp[A[i]] ++;
        if(mp[A[i]] == 1)
        {
            ans.pb(i);
            used[i] = 1;
        }
        mp[A[i]] %= 2;
        //g.pb(make_pair(A[i], i));
    }
    //sort(g.begin(), g.end());
    //vector < int > ans;
    for (int i = 0; i < n; ++ i)
    {
        if(used[i])continue;
        ans.pb(i);
    }
    return ans;
}
