Bloomberg Interview Question

valid anagram flatten the doubly linked list