Bloomberg interview question

flatten a multilevel linked list