Open Clear2 opened 4 years ago
func findRepeatNumber(nums []int) int { maps := make(map[int]bool) for _,num:=range nums{ if maps[num]{ return num }else{ maps[num]=true } } return -1 }
hash表的解法,不算太好
hash表的解法,不算太好