Single Number

来源:互联网 发布:微分销系统源码下载 编辑:程序博客网 时间:2024/06/15 13:00


public class Solution {    public int singleNumber(int[] nums) {        if (nums == null || nums.length == 0) {            return -1;        }        int result = 0;        for (Integer i : nums) {            result ^= i;        }        return result;    }}


0 0