L587 Two Sum VI - Unique two sum pairs
Given an array of integers, find how manyunique pairs
in the array such that their sum is equal to a specific target number. Please return the number of pairs.
Example
Given nums =[1,1,2,45,46,46]
, target =47
return2
1 + 46 = 47 2 + 45 = 47
这题是得注意去重,在找到答案以后要跳过相同的数字不断移动指针。
Last updated