Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int n,nr,res;
- unordered_map<int,int> m;
- int main()
- {
- cin>>n;
- for(int i=0;i<n;++i)
- cin>>nr,++m[nr];
- res=INT_MAX;
- for(auto it=m.begin();it!=m.end();++it)
- if(it->second==1)
- res=min(res,it->first);
- cout<<res;
- return 0;
- }
Add Comment
Please, Sign In to add comment