#include <iostream>
#include <cmath>
#include <map>
#include "partition.h"

std::vector<int> solve(std::vector<int> A)
{
    std::map<int,int> v;
    int n = A.size();
    for(auto i : A)
        v[i]++;
    for(auto i : v)
        i.second/=2;
    std::vector<int> sol;
    for(int i=0;i<n;i++)
    {
        if(v[A[i]]>0)
        {
            v[A[i]]--;
            sol.push_back(i);
        }
    }
    return sol;
}
