Help with logic

sol: https://ide.codingblocks.com/s/394181

prob: https://hack.codingblocks.com/app/contests/2022/1290/problem

what I figured out was that the same elements are stored simultaneously, so Im trying to increment i with 2 instead of 1 for skipping the repeated element

Hey @raghav007

    sort(ans.begin(),ans.end());
    string temp = "";
    for(int i = 0;i<ans.size();i++)
    {
         if(temp != ans[i])
                cout<<ans[i]<<endl;
         temp = ans[i];
    }

print using this