import math
def findPairs(nums, k):
    if not nums or k < 0:
            return 0
        
        # if k == 0:
        #     return len(nums)
        
        # nums = list(set(nums))
    dic = {}
    count = 0
    for i in range(len(nums)):
        for j in  range(i+1, len(nums)):
            if nums[i] - nums[j] in (k, -k):
                if (nums[i], nums[j]) in dic or (nums[j], nums[i]) in dic:
                    pass
                else:
                    count += 1
                    dic[(nums[i], nums[j])] = dic[(nums[j], nums[i])] = 1
                
    return count

a = [3,1,4,1,5]
print(findPairs(a, 2))

n = 1
def f(n):
    return False if n else True
print(f(n))

print(int(math.log10(10)))
a = 'abc'
print(a.split())
print(ord('A'), ord('a'))
b4476fb141863e326921156112848da92d9093b2
<mask token>


def findPairs(nums, k):
    if not nums or k < 0:
        return 0
    dic = {}
    count = 0
    for i in range(len(nums)):
        for j in range(i + 1, len(nums)):
            if nums[i] - nums[j] in (k, -k):
                if (nums[i], nums[j]) in dic or (nums[j], nums[i]) in dic:
                    pass
                else:
                    count += 1
                    dic[nums[i], nums[j]] = dic[nums[j], nums[i]] = 1
    return count


<mask token>


def f(n):
    return False if n else True


<mask token>

<mask token>


def findPairs(nums, k):
    if not nums or k < 0:
        return 0
    dic = {}
    count = 0
    for i in range(len(nums)):
        for j in range(i + 1, len(nums)):
            if nums[i] - nums[j] in (k, -k):
                if (nums[i], nums[j]) in dic or (nums[j], nums[i]) in dic:
                    pass
                else:
                    count += 1
                    dic[nums[i], nums[j]] = dic[nums[j], nums[i]] = 1
    return count


<mask token>
print(findPairs(a, 2))
<mask token>


def f(n):
    return False if n else True


print(f(n))
print(int(math.log10(10)))
<mask token>
print(a.split())
print(ord('A'), ord('a'))

<mask token>


def findPairs(nums, k):
    if not nums or k < 0:
        return 0
    dic = {}
    count = 0
    for i in range(len(nums)):
        for j in range(i + 1, len(nums)):
            if nums[i] - nums[j] in (k, -k):
                if (nums[i], nums[j]) in dic or (nums[j], nums[i]) in dic:
                    pass
                else:
                    count += 1
                    dic[nums[i], nums[j]] = dic[nums[j], nums[i]] = 1
    return count


a = [3, 1, 4, 1, 5]
print(findPairs(a, 2))
n = 1


def f(n):
    return False if n else True


print(f(n))
print(int(math.log10(10)))
a = 'abc'
print(a.split())
print(ord('A'), ord('a'))

import math


def findPairs(nums, k):
    if not nums or k < 0:
        return 0
    dic = {}
    count = 0
    for i in range(len(nums)):
        for j in range(i + 1, len(nums)):
            if nums[i] - nums[j] in (k, -k):
                if (nums[i], nums[j]) in dic or (nums[j], nums[i]) in dic:
                    pass
                else:
                    count += 1
                    dic[nums[i], nums[j]] = dic[nums[j], nums[i]] = 1
    return count


a = [3, 1, 4, 1, 5]
print(findPairs(a, 2))
n = 1


def f(n):
    return False if n else True


print(f(n))
print(int(math.log10(10)))
a = 'abc'
print(a.split())
print(ord('A'), ord('a'))

import math
def findPairs(nums, k):
    if not nums or k < 0:
            return 0
        
        # if k == 0:
        #     return len(nums)
        
        # nums = list(set(nums))
    dic = {}
    count = 0
    for i in range(len(nums)):
        for j in  range(i+1, len(nums)):
            if nums[i] - nums[j] in (k, -k):
                if (nums[i], nums[j]) in dic or (nums[j], nums[i]) in dic:
                    pass
                else:
                    count += 1
                    dic[(nums[i], nums[j])] = dic[(nums[j], nums[i])] = 1
                
    return count

a = [3,1,4,1,5]
print(findPairs(a, 2))

n = 1
def f(n):
    return False if n else True
print(f(n))

print(int(math.log10(10)))
a = 'abc'
print(a.split())
print(ord('A'), ord('a'))