Contains Duplicate
2015-09-18 12:53
375 查看
public class Solution { public boolean containsDuplicate(int[] nums) { HashMap<Integer, Boolean> map = new HashMap<Integer, Boolean>(); int i; for (i = 0; i < nums.length; i++) { if (map.containsKey(nums[i])) { return true; } else { map.put(nums[i], true); } } return false; } }
相关文章推荐
- 添加第三方类库造成的linker command failed with exit code 1 (use -v to see invocation)的错误调试
- Magic Pairs - SGU 119(同余)
- 升级xcode7之后,真机调试出现BaiduMapAPI.framework/BaiduMapAPI(BMAddrList.o)' does n 4000 ot contain bitcode的问题
- INSTALL_FAILED_DUPLICATE_PERMISSION
- Contains Duplicate 重复数的判断
- 端口状态说明 LISTENING、ESTABLISHED、TIME_WAIT及CLOSE_WAIT
- SSH 错误解决案例1:Read from socket failed: Connection reset by peer
- grails Tags
- grails自定义标签
- grails检索mongodb
- 中国是大数据的人工智能的发源地
- codis扩容报错:[error] READONLY You can't write against a read only slave
- Error:(27, 42) 错误: <匿名com.jeff.networktest.MainActivity$1>不是抽象的, 并且未覆盖Handler中的抽象方法publish(LogRecord
- 纪念人工智能(AI)奠基60周年
- Contains Duplicate III
- Contains Duplicate III
- 磁盘阵列RAID
- CodeForces-509B Painting Pebbles
- WaitHandle.WaitOne()中的exitContext参数作用
- 自定义View(二)、Canvas和Paint的用法、BitMap