func duplicateInArray(nums []int) int {
for _,value:=range nums{
if value<0 || value>=len(nums){
return -1
}
}
ss:=make([]int,0)
for i,_:=range nums{
flag:=true
for j,_ :=range ss{
if nums[i]==ss[j]{
flag = false
return nums[i]
}
}
if flag {
ss=append(ss,nums[i])
}
}
return -1
}