/**
 * Author : Laberat
 * Date   : 16/2/2.
 * Link   : https://leetcode.com/problems/single-number/
 * Number : # 136
 * Desc   : Given an array of integers, every element appears twice except for one.
 *          Find that single one.
 *          Your algorithm should have a linear runtime complexity.
 *          Could you implement it without using extra memory?
 */
public class SingleNumber {
    public int singleNumber(int[] nums) {
        int result = 0;
        for (int i : nums) {
            result ^= i;
        }
        return result;
    }

    public static void main() {
        int[] nums = {1,2,3,1,2,3,4};
        SingleNumber s = new SingleNumber();
        int res = s.singleNumber(nums);
        System.out.println(res);
    }
}

@@ -555,202 +555,7 @@
    %7D
-%0A%0A    public static void main() %7B%0A        int%5B%5D nums = %7B1,2,3,1,2,3,4%7D;%0A        SingleNumber s = new SingleNumber();%0A        int res = s.singleNumber(nums);%0A        System.out.println(res);%0A    %7D
 %0A%7D%0A

solve #136