赞
踩
题目:
题解:
- func containsDuplicate(nums []int) bool {
- set := map[int]struct{}{}
- for _, v := range nums {
- if _, has := set[v]; has {
- return true
- }
- set[v] = struct{}{}
- }
- return false
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。