Given array of length n with m sorted segments, Sort the entire array in the most optimal way.
Focus on the m sorted segment and how to use them wisely.
For Instance [4, 5 , 6, 1, 2,3, 8, 7] here n = 8 and m = 3
3 sorted segment being - [4,5,6], [1, 2, 3, 8], [7]
Solved this one with 2 pointer and minHeap