Given an unsorted array, find the least difference between the element pairs. Display all the pairs present.
Problem Statement: Given an unsorted array, list all the pairs with a least difference. Example: Input: {5, 4, 3, 2, 1} Output: {1, 2}, {2,…