solution to Flatten Binary Tree to Linked List