There are multiple ways to find the pair of numbers in a given array. The numbers in the array can be in two ways.

SortedUnsorted If the numbers are sorted then we can get easily with the complexity of O(n). The brute force approach will be easily applicable for both the sorted and unsorted array of numbers.

SortedUnsorted If the numbers are sorted then we can get easily with the complexity of O(n). The brute force approach will be easily applicable for both the sorted and unsorted array of numbers.