[Leetcode] Single Number
2015-03-22 02:36
246 查看
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?
public class Solution { public int singleNumber(int[] A) { int result = 0; for (int i = 0; i < A.length; i++) { result = result^A[i]; } return result; } }
相关文章推荐
- Leetcode 136 Single Number 仅出现一次的数字
- leetcode 135: Single Number
- leetcode 136. Single Number
- leetcode_c++:哈希:Single Number(136)
- leetcode —— single number
- LeetCode-Easy部分标签为HashTable#136 Single Number
- LeetCode:Single Number
- 4000 leetcode 136.Single Number
- LeetCode - Single number- Jan 31, 2015
- LeetCode:Single NumberⅡ
- LeetCode 136 -Single Number ( JAVA )
- Single Number 【leetcode】1分钟解题系类
- leetcode136 Single Number136 Java
- LeetCode 136. Single Number
- leetcode_single number
- leetcode[136]Single Number
- Single Number(leetcode)
- [LeetCode] Single Number
- LeetCode 136. Single Number
- LeetCode 136: Single Number