Created
August 21, 2017 04:03
-
-
Save luojiyin1987/7c8d150b4abec2ef9d347a20098f3b6e to your computer and use it in GitHub Desktop.
Contains Duplicate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func containsDuplicate(nums []int) bool { | |
| temp := make(map[int]int) | |
| for _, v := range nums { | |
| temp[v]++ | |
| if temp[v] >1 { | |
| return true | |
| } | |
| } | |
| return false | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment