Find only unique number in vector
You can use a more efficient algorithm. It's clear that the unique value is equal to the xor of all numbers in the vector. One can write a nice one-liner to compute it:

std::accumulate(v.begin(), v.end(), (uint32_t)0, [](uint32_t a, uint32_t b) { return a ^ b; })


The time complexity is the same (as a hash table works in O(1) on average), but this code is likely to work faster in practice. It also requires O(1) extra memory, while your solution needs O(n), so it's more space efficient.

I'd also say that your code is little bit confusing (it inserts keys implicitly via [] operator but erases them explicitly). It took me a while to figure out what's going on. I think that the solution with a set is a little bit more clear as it makes all insertions and deletions explicitly:

unordered_set&lt;uint32_t&gt; seen;
for (const auto&amp; elem : v) {
     if (seen.count(elem))
         seen.erase(elem);
     else
         seen.insert(elem);
}
return *seen-&gt;begin();


You can also omit return 0 in the main function (it returns 0 by default, anyway).