#include #include #include int main(int argc, char** argv) { std::vector foo = {0, 0, 1, 1, 1, 2, 2}; std::unordered_map counts; for (auto& v : foo) { if (counts.find(v) == counts.end()) { counts[v] = 0; } counts[v]++; } for (auto& v : counts) { if (v.second % 2 != 0) { std::cout << v.first << std::endl; } } return 0; }