Question 3 Solution | Duplicate Elements Solution | Codewindow.in

//codewindow.in
//solution function in C++
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin>>n;
    set<int> s;
    for(int i=0;i<=n;i++)
    {
        int x;
        cin>>x;
        s.insert(x);
    }
    cout<<s.size();
  return 0;
}

Follow us

Also Checkout

Leave a Comment

Your email address will not be published. Required fields are marked *