跳至主要内容

136. 只出现一次的数字

class Solution {
public:
    int singleNumber(vector<int>& nums) {
        int ret = 0;
        for (int i = 0; i < nums.size(); i++)
        {
            ret ^= nums[i];
        }
        return ret;
    }
};

评论

此博客中的热门博文

shadowsocks android编译

git clone https://github.com/shadowsocks/shadowsocks-android.git cd shadowsocks-android git submodule update --init --recursive chmod a+rwx ./ -R docker run --rm -v ${PWD}:/build -w /build shadowsocks/android-ndk-go ./gradlew assembleDebug