标签:++ return 哈希表 bsp contains pre tco hash nbsp
//通过哈希表来查重 class Solution { public boolean containsDuplicate(int[] nums) { Set<Integer> set = new HashSet<>(); for(int i = 0;i < nums.length;i++){ if(set.contains(nums[i])) return true; set.add(nums[i]); } return false; } }
标签:++ return 哈希表 bsp contains pre tco hash nbsp
原文地址:https://www.cnblogs.com/peanut-zh/p/13891745.html