http://www.careercup.com/question?id=16759664
You have k lists of sorted integers. Find the smallest range that includes at least one number from each of the k lists.
For example,
List 1: [4, 10, 15, 24, 26]
List 2: [0, 9, 12, 20]
List 3: [5, 18, 22, 30]
The smallest range here would be [20, 24] as it contains 24 from list 1, 20 from list 2, and 22 from list 3.
'풀어본 Algorithm 문제 정리' 카테고리의 다른 글
[Oj.leetcode] generate-parentheses (1) | 2014.09.05 |
---|---|
[OJ.leetcode] rotate-image (0) | 2014.08.30 |
[OJ.leetcode] plus-one (0) | 2014.08.29 |
[OJ.leetcode] remove-duplicates-from-sorted-array (0) | 2014.08.28 |
[OJ.leetcode] balanced-binary-tree (0) | 2014.08.28 |