Bloomberg Interview Question

1. Make a deep copy of a linked list with an additional random pointer. Remove multiple intervals from an array.

Interview Answer

Anonymous

Oct 7, 2018

1. Using a hashmap this can be done in O(n) time. 2. By sorting the intervals, this can be done in O(n + klogk) time where n is the size of the array and k is the number of intervals to be removed.