217 Contains Duplicate
2015-05-30 08:16
405 查看
public class Solution { public boolean containsDuplicate(int[] nums) { HashSet<Integer> hs = new HashSet<Integer>(); for (int i : nums) { if (hs.contains(i)) { return true; } else { hs.add(i); } } return false; } }
相关文章推荐
- Contains Duplicate II
- leetcode#70 Climbing Stairs
- LeetCode "Contains Duplicate II"
- [LeetCode] Contains Duplicate II 包含重复值之二
- Contains Duplicate II
- [main] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database
- POJ 3250 Bad Hair Day 简单DP 好题
- Andriod SDK出现Failed to parse the output of 'adb version'问题
- leetcode 11 -- Container With Most Water
- Chinese Remainder Theorem
- POJ_3421_X-factor Chains(素数筛法)
- Android快捷开关实现【http://blog.csdn.net/stevenhu_223/article/details/9052083】
- solr-DIH:dataimport增量全量创建索引
- CCNA training notes
- STM32使用J-Link烧写出错:Error: Flash Download failed - Cortex-M3
- Handler一定要在主线程实例化吗?new Handler()和new Handler(Looper.getMainLooper())的区别
- zabbix 之 zabbix-server配置邮件系统
- 【leetcode】Contains Duplicate I && II
- Host key verification failed解决
- NBUT 1118 Marisa's Affair (排序统计,水)