1. Title
Single Number
2. Http address
https://leetcode.com/problems/single-number/
3. The question
Given an array of integers, every element appears twice except for one. Find that single one.
4. My code (AC)
1 //Accepted 2 public int singleNumber(int[] nums) { 3 4 int re = 0; 5 int len = nums.length; 6 for(int i = 0 ; i < len ;i++) 7 { 8 re ^= nums[i]; 9 } 10 return re; 11 }