Flatten Binary Tree to Linked List
Given a binary tree, return a linked list that is a "flattened" version of the tree.
The linked list still uses the same nodes as a normal binary tree, only the left subtree is always empty, and the right subtree always points to the next element in the linked list (or the empty tree).
The flattened tree represents the pre-order traversal of the tree.
tree = <See explanation>
<See explanation>
Input tree:

Flattened tree:

Note that this uses the binary tree structure to represent the linked list.