Join Regular Classroom : Visit ClassroomTech

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