#include "partition.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> solve(std::vector<int> A)
{
    map<int, int>freq;
    for(int br : A)
    {
        freq[br]++;
    }
    vector<int>V;
    for(int br : A)
    {
        int x=freq[br];
        freq[br]=0;
        for(int i=0;i<x/2;i++)
        {
            V.push_back(br);
        }
    }
    for(int br : V)
    {
        V.push_back(br);
    }
    return {V};
}
