LintCode: Minimum Difference

Minimum Difference



Similar Problems:


Description

Given a 2D array size of n * m and the elements of each row of the array are sorted. Select 1 number from each row and select n numbers in total. And the diff of n numbers is maximum-minimum, find the minimum diff.

Example

Input: [[1,2,3,4,5],[6,7,8,9,10]]
Output: 1

Github: code.dennyzhang.com

Credits To: lintcode.com

Leave me comments, if you have better ways to solve.


  • Solution: XXX

General Thinkings:


Key Observations:


Walk Through Testdata


// Blog link: https://code.dennyzhang.com/minimum-difference

linkedin
github
slack

Share It, If You Like It.

Leave a Reply

Your email address will not be published.