摘要:
前序遍历+排序. 时间复杂度: O(nlogn) 空间复杂度: O(n) 1 class Solution { 2 private int res=Integer.MAX_VALUE; 3 private ArrayList<Integer> arry=new ArrayList<>(); 4 pu 阅读全文
摘要:
哈希表,暴力. 1 class Solution { 2 public int singleNumber(int[] nums) { 3 Set<Integer> map=new HashSet<>(); 4 for(int num:nums){ 5 if(map.contains(num)){ 6 阅读全文