遍历数组将数组存入Hashset
添加过程中如果存在remove()移除
最后取出hashset中的那一个元素返回
class Solution {
public int singleNumber(int[] nums) {
int a=0;
HashSet set=new HashSet();
for(int i=0;i

遍历数组将数组存入Hashset
添加过程中如果存在remove()移除
最后取出hashset中的那一个元素返回
class Solution {
public int singleNumber(int[] nums) {
int a=0;
HashSet set=new HashSet();
for(int i=0;i