[LeetCode] [Single Number 2013-10-01]
2014-05-14 14:27
441 查看
Given an array of integers, every element appears twice except for one. Find that single one.
Note: Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?
Note: Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?
class Solution { public: int singleNumber(int A[], int n) { int s = 0; for(int i =0 ;i< n; i++) { s = s^A[i]; } return s; } };
相关文章推荐
- leetcode:Single Number
- 10--LeetCode【Single Number】|C语言|
- Leetcode:136. Single Number
- [leetcode-136]Single Number(c)
- Leetcode: Single Number(136,137). 位运算解法分析
- LeetCode_Single Number
- 【Leetcode-easy-136】Single Number
- leetcode 135: Single Number
- Single Number--LeetCode
- leetcode|Single Number(136)
- 【LeetCode】Single Number
- LeetCode:Single Number
- [leetcode] Single Number
- 【LeetCode从零单刷】Single Number
- The Solution to Leetcode 136 Single Number
- 【LeetCode】Single Number
- leetcode[136] Single Number
- Java [Leetcode 136]Single Number
- LeetCode 136 Single Number 出现一次的数字
- LeetCode136—Single Number