Computer Science, asked by InshaHashmi8223, 11 months ago

Find two elements in an array whose difference is given no k

Answers

Answered by Anonymous
0

Find a pair with the given difference

Given an unsorted array and a number n, find if there exists a pair of elements in the array whose difference is n.

Examples:

Input: arr[] = {5, 20, 3, 2, 50, 80}, n = 78

Output: Pair Found: (2, 80)

Input: arr[] = {90, 70, 20, 80, 50}, n = 45

Output: No Such Pair

PLEASE MAKE ME AS A BRAINLIST ANSWER

Similar questions
Math, 1 year ago