Skip to content

Instantly share code, notes, and snippets.

Created August 29, 2015 17:45
What would you like to do?
m, n = raw_input().split()
m = int(m)
n = int(n)
e_list = []
e_list = raw_input().split()
combination = [(e_list[i],e_list[j]) for i in range(len(e_list)) for j in range(i+1, len(e_list))]
difference = []
for e in combination:
difference.append(abs(int(e[0]) - int(e[1])))
count = 0
for d in difference:
if d == n:
print count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment