Distinct 發表於 2023-02-13 | 分類於 codility , sorting problemsolutionoption 1 - set12345678910111213// you can use includes, for example:// #include <algorithm>// you can write to stdout for debugging purposes, e.g.// cout << "this is a debug message" << endl;#include<unordered_set>int solution(vector<int> &A) { // write your code in C++14 (g++ 6.2.0) unordered_set<int> s; for(int a:A) s.insert(a); return s.size();} option 2 -1 analysis optino 1 time complexity O(n) space complexity O(n)