OddOccurrencesInArray 發表於 2023-02-13 | 分類於 codility , Array problemsolution123456789101112// 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;int solution(vector<int> &A) { // write your code in C++14 (g++ 6.2.0) int ret = 0; for(int a:A) ret^=a; return ret;} analysis time complexity O(n) space complexity O(1)