Skip to content
C

Pair with Given Difference

Easyjavapythonccppjavascript

Given an array and an integer D, determine whether two elements at different positions have an absolute difference of exactly D.

Input Format

The first line contains two integers N and D. The second line contains N space-separated integers.

Output Format

Print 1 if such a pair exists, otherwise print 0.

Input (stdin)

Output

Run your code to see output here...