#include <bits/stdc++.h>
#include "partition.h"
using namespace std;

vector<int> solve(vector<int> v) {
    int n=v.size();
    vector<int> v1,v2,ans;
    map<int,int> M;
    for (int i=0; i<n; i++) {
        M[v[i]]++;
        if (M[v[i]]%2==1) v1.push_back(i);
        else v2.push_back(i);
    }
    for (int i=0; i<v1.size(); i++) {
        ans.push_back(v1[i]);
    }
    for (int i=0; i<v2.size(); i++) {
        ans.push_back(v2[i]);
    }
    return ans;
}
