leetcode Contains Duplicate
2015-05-31 10:33
288 查看
水题
题目链接这里
题目链接这里
public class Solution { public boolean containsDuplicate(int[] nums) { HashSet<Integer> myHashSet=new HashSet<Integer>(); for(int i=0;i<nums.length;i++) { if(myHashSet.contains(nums[i])) { return true; } else { myHashSet.add(nums[i]); } } return false; } }
相关文章推荐
- IDR_MAINFRAME 字符串 MFC
- #LeetCode OJ #11 Container With Most Water
- 关于Error: xz compression not available
- Solving "Vietnam snake" puzzle with constraint logic programming
- 使用行为树(Behavior Tree)实现游戏AI
- Failed to find provider info for com.google.settings
- leetcode Factorial Trailing Zeroes
- [LeetCode] Contains Duplicate II
- 【Flume】Rpc sink XX closing Rpc client:NettyAvroRpcClient {xx} …… Failed to send events 问题解决
- Cuda kernel failed. Error: invalid device function
- 安装scikit-learn,win7 64位 (装了一下午,终于搞定了)解决ImportError: DLL load failed
- Contains Duplicate
- LeetCode217:Contains Duplicate
- reason:'CALayer position contains NaN: [160 nan]'
- POJ 1363 : Rail - 栈
- a Dll project without DllMain ?
- Agent admitted failure to sign using the key
- Aizu 2251 Merry Christmas(二分图最大匹配+Floyd)
- netstat监控大量ESTABLISHED连接与Time_Wait连接问题
- xCode模拟器出现installation failed invalid argument