只出现一次的数字 { int i = 0; int ret = 0; for (i = 0; i < n; i++) ret ^= a[i]; return ret; } 掌握方法之后就很简单,并且把时间复杂度控制在了线性时间复杂度。 灵活运用异或运算的方法。