1.Given K sorted lists of integers of size N each
2.Find the smallest range that includes at least one element from each of the K lists.
3.If more than one such range's are found, print the first such range found.
4.You have to complete the function findSmallestRange() to print such range found.
Input Format
1.First line contains two space separated integer 'N' and 'K' denoting the size of the array and number of list respectively. 2.Next line contains N*K elements of the 2-D array where each row represent an individual list.
Output Format
Print two space separated intger denoting the required range
Constraints
1 <= K,N <= 500
Notice
Try First, Check Solution later
1. You should first read the question and watch the question video.2. Think of a solution approach, then try and submit the question on editor tab.3. We strongly advise you to watch the solution video for prescribed approach.Example
Input
5 3 1 3 5 7 9 0 2 4 6 8 2 3 5 7 11
Output
1 2