首页 > 代码库 > 2017-3-7-lint82single-number

2017-3-7-lint82single-number

2017-3-7-lint82single-number

在河之洲
算法
小书匠

problem

82single-number/

solution

    int singleNumber(vector<int> &A) {
        // write your code here
        if (A.empty())
            return 0;
        int result = A[0];
        for (int i = 1; i < A.size(); i++)
        {
            result = result ^ A[i];
        }
        return result;
    }

2017-3-7-lint82single-number