码迷,mamicode.com
首页 > 其他好文 > 详细

Leetcode刷题第003天

时间:2019-03-23 22:44:38      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:出现   return   tco   int   etc   pre   nbsp   数字   solution   

一、只出现一次的数字

 1 class Solution {
 2 public:
 3     int singleNumber(vector<int>& nums) 
 4     {
 5         int res = 0;
 6         for (auto num : nums) 
 7             res ^= num;
 8         return res;
 9     }
10 };

 

Leetcode刷题第003天

标签:出现   return   tco   int   etc   pre   nbsp   数字   solution   

原文地址:https://www.cnblogs.com/sunbines/p/10585733.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!