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.
  • Hackerrank Home
  • Prepare
    NEW
  • Certify
  • Compete
  • Career Fair
  • Hiring developers?
  1. Prepare
  2. C++
  3. STL
  4. Sets-STL
  5. Discussions

Sets-STL

Problem
Submissions
Leaderboard
Discussions

Sort 287 Discussions, By:

recency

Please Login in order to post a comment

  • aadinew7
    2 weeks ago+ 0 comments

    Here are the solution of Sets-STL in C++ Hacker Rank Solution

    0|
    Permalink
  • poonamdeorasurp1
    3 weeks ago+ 0 comments

    Here is problem solution - https://thecscience.com/hackerrank-sets-stl-in-cpp-problem-solution.html

    0|
    Permalink
  • brokenprogramme1
    3 weeks ago+ 0 comments

    Here is the Solution of Sets-STL in C++ HackerRank Solution https://www.brokenprogrammers.com/sets-stl-in-cpp-hackerrank-solution

    0|
    Permalink
  • poonamdeorasurp1
    1 month ago+ 0 comments

    Here is problem solution - https://thecscience.com/hackerrank-sets-stl-in-cpp-problem-solution.html

    0|
    Permalink
  • garghimanshu1512
    1 month ago+ 0 comments

    include

    include

    include

    include

    include

    include

    using namespace std;

    int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */

    int n;
    cin>>n;
    
    set<int> s;
    
    while(n--){
        int a,b;
        cin>>a>>b;
        if(a==1){
            s.insert(b);
        }
        else if(a==2){
            s.erase(b);
        }
        else if(a==3){
            set<int>::iterator itr = s.find(b);
            if(itr!=s.end()){
                cout<<"Yes"<<endl;
            }
            else{
                cout<<"No"<<endl;
            }
        }
    }
    
    return 0;
    

    }

    
    
    0|
    Permalink
Load more conversations

Need Help?


View top submissions
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy