Facebook | Phone | Merge K Sorted Subarrays
Anonymous User
1906

Kinda strange one, I had only 1 question sorta similar to Merge K sorted lists, but instead of sorted lists it was a single array that had sorted blocks.

Say, [1, 2, 3, | 7, 11, 121, | 4, 5, 21]

I solved in O(nk) time where n was size of array and k was number of divisions. Interviewer explained there was an O(nlogk) solution but didn't seem pressed I didn't get it. He was very nice, but I wasn't sure how I'd do because my answer wasn't optimal.

Two business days later I got news I was good to go for the onsite.

Comments (7)