Input

[1, 5, 2, 2, 2, 5, 5, 4]

K = 3, i = 0, j = 7

Algo

def find_KDiff_Pair(arr, K):
	for num in arr:
		if binarySearch(arr, size(arr), num - K):
			# We have a Count

Time Complexity