Sort K arrays
HardGiven an array of
k
sorted arrays of numbers, return a single sorted array containing all numbers from the k
arrays.For example, if
k = 3
with the following input array:arrs = [ [2, 3, 7], [-3, -2, 6], [4, 5, 9] ]
Your function should return:
[ -3, -2, 2, 3, 4, 5, 6, 7, 9 ]
Note that the input arrays could be different sizes.
Solution
9 Essential Trees & Graphs Coding Interview Problems
Master Trees & Graphs by trying the coding challenges below.
- 1.Inorder TraversalEasy
- 2.Tree SumEasy
- 3.Tree HeightEasy
- 4.LCAMedium
- 5.Max Path SumHard
- 6.Search mazeMedium
- 7.Number of islandsMedium
- 8.Kth SmallestMedium
- 9.Sort K ArraysHard