Pairs with Specific Difference python
The code in the post (and in WolframH's answer) has a bug:

&gt;&gt;&gt; find_pairs_with_given_difference([1], 0)
[[1, 1]]


There is no pair of items [1, 1] in the input array.