C++ single line solution


#1
#include <numeric>
int Solution::singleNumber(const vector<int> &A) {
    return accumulate(A.begin(), A.end(), 0, [](int a, int b){return a^b;});
}