convert array to set c 2b 2b

Solutions on MaxInterview for convert array to set c 2b 2b by the best coders in the world

showing results for - "convert array to set c 2b 2b"
David
24 Nov 2017
1#include <iostream>
2#include <unordered_set>
3 
4int main()
5{
6    int A[] = { 1, 2, 3, 4, 5 };
7 
8    std::unordered_set<int> s;
9    for (int i: A) {
10        s.insert(i);
11    }
12 
13    for (int i: s) {
14        std::cout << i << " ";
15    }
16 
17    return 0;
18}
19
Ren
20 Aug 2016
1set<int> res(arr, arr + sizeArr);