Skip to content

Commit

Permalink
Create sets-STL-HR.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
saksham101 authored Dec 14, 2020
1 parent 4a92b31 commit 0d5afb3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions sets-STL-HR.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <bits/stdc++.h>
using namespace std;


int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int n, q, val;
set<int> s;
cin>>n;
for(int i=0;i<n;i++){
cin>>q>>val;
if(q == 1){
s.insert(val);
}
else if(q == 2){
s.erase(val);
}
else{
cout<<(s.find(val) == s.end() ? "No" : "Yes")<<endl;
}
}
return 0;
}

0 comments on commit 0d5afb3

Please sign in to comment.