Find two elements in an array whose difference is given no k
Answers
Answered by
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
Social Sciences,
5 months ago
English,
5 months ago
History,
11 months ago
Business Studies,
11 months ago
English,
1 year ago