Problem Description
Given an array A of integers and another non negative integer B .
Find if there exists 2 indices i and j such that A[i] - A[j] = B and i != j.
1 <= |A| <= 106
0 <= A[i] <= 109
0 <= B <= 109
First argument A is an array of integer
Second argument B is an integer
A = [1, 5, 3] B = 2Input 2:
A = [2, 4, 3] B = 3
1Output 2:
0
The given value of A[1] = 1 and A[3] = 3. The value of A[3] - A[1] = 2.For Input 2:
There are no pairs such that difference is B.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.