Pairs | HackerRank
Given an array of integers and a target value, determine the number of pairs of array elements that have a difference…www.hackerrank.com Task:- Given an array ‘arr’ and an integer ‘k’. Find the number of pairs whose difference is equal to value k. For eg:- arr = [ 4, 6, 8, 10, 7] and k = 2. The pairs which satisfy the conditions are (4, 6), (6, 8), (8, 10). So the…