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


vector<int>solve(vector<int>A)
{
      vector<int>v1,v2;
      map<int,int>mp;
      for(int i=0;i<A.size();i++){
            mp[A[i]]++;
            if(mp[A[i]]&1) v1.push_back(i);
            else v2.push_back(i);
      }
      vector<int>res;
      for(int x:v1) res.push_back(x);
      for(int x:v2) res.push_back(x);
      return res;
}
