class Solution:
def countPairs(self, nums: List[int], target: int) -> int:
nums.sort()
num=0
n=len(nums)
low=0
high=n-1
while(low<high):
if(nums[low]+nums[high]>=target):
high-=1
else:
num+=high-low
low+=1
return num
num+=high-low 这步,没有想到low不动 大的不断减少一定满足条件