Bloomberg interview question

Flatten a double linked list into array