Given a binary tree where all the right nodes are either empty or leaf
nodes, flip it upside down
and turn it into a tree with left leaf nodes.
* In the original tree, if a node has a right child, it also must have a
left child.
* 1 1
* / \ / \
* 2 3 2 3
* /
* 4
* / \
* 5 6
Will be translated into:
*
* 1 1
* / /
* 2---3 2---3
* /
* 4
* /
* 5---6
我的解法: follow the left node all the way to the leftmost node, and
transform each left node on the way.
其实题目不难。就是一慌就乱阵脚。。继续努力练习。