摘要: 这题如果用一般数据结构来解决,存在很多种解法,比如:通过hashmap记录出现的次数,最后遍历得到次数为1的数。或者通过hashset添加数字,如果无法添加就删除该数字。 public int singleNumber(int[] nums) { Set<Integer> hset=new Hash 阅读全文
posted @ 2021-10-08 11:21 毅毅毅毅毅 阅读(50) 评论(0) 推荐(0)