func twoSum(nums []int, target int) []int {
func longestConsecutive(nums []int) int {
if len(nums) == 0 {
return 0
}
sort.Ints(nums)
max, tmp := 0, 1
last := nums[0]
for i := 1; i < len(nums); i++ {
if nums[i]-last == 1 {
tmp += 1
} else if nums[i] == last {
continue
} else {
if tmp >= max {
max = tmp
}
tmp = 1
}
last = nums[i]
}
if tmp > max {
max = tmp
}
return max
}
}