StackAdapt interview question

Linked List, BFS