Lonely Integer

  • + 0 comments

    The solution to the problem is by summing xor values;

    return std::accumulate(a.begin(), a.end(), 0, std::bit_xor<int>{});