#include "partition.h"
#include <bits/stdc++.h>
std::vector<int> solve(std::vector<int> A)
{
    long long k,i,j,sum,v[100001],nr,fr[100001],p1=-1,p2=-1,rez;
    nr=A.size();
    for(i=0;i<=nr-1;i++)
    {
    fr[A[i]]++;
    rez=A[i];
    if(fr[A[i]]==1) p1++,switch(A[p1],A[i]);
    else p2++,switch(A[nr/2+p2],A[i]);
    }
 return A;
}

