We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
int q;
cin>>q;``
while(q>0)
{
int y, x;
cin>>y>>x;
if(y==1){qX.insert(x);}
if(y==2){qX.erase(x);}
if(y==3){
auto it = qX.find(x);
if(it != qX.end()){cout<<"Yes\n";}
else{cout<<"No\n";}
}
q--;}
Here is my solution!
int main() { set s; int q; int a; int y; cin>>q; while(q>0){ cin>>a; if(a==1){ cin>>y;
}
Here is Sets-STL problem solution in C++ - https://programmingoneonone.com/hackerrank-sets-stl-solution-in-cpp.html