@@ -0,0 +1,618 @@
+/**%0A * Definition for a binary tree node.%0A * public class TreeNode %7B%0A *     int val;%0A *     TreeNode left;%0A *     TreeNode right;%0A *     TreeNode(int x) %7B val = x; %7D%0A * %7D%0A */%0Aclass Solution %7B%0A    public void flatten(TreeNode root) %7B%0A        %0A        if (root != null) %7B%0A            flatten(root.left);%0A            flatten(root.right);%0A            %0A            TreeNode node = root.right;%0A            root.right = root.left;%0A            root.left = null;%0A            %0A            while (root.right != null) %7B%0A                root = root.right;%0A            %7D%0A            %0A            root.right = node;%0A        %7D%0A    %7D%0A%7D

add no.144