package leetcode;

/**
 * https://leetcode.com/problems/find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/
 */
public class Problem1379 {
    public static class TreeNode {
        int val;
        TreeNode left;
        TreeNode right;

        TreeNode(int x) {
            val = x;
        }
    }

    public final TreeNode getTargetCopy(final TreeNode original, final TreeNode cloned, final TreeNode target) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
    }
}

@@ -437,88 +437,343 @@
     
-// TODO%0A        return null;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B
+if (original == null) %7B%0A            return null;%0A        %7D%0A        if (original == target) %7B%0A            return cloned;%0A        %7D%0A        TreeNode left = getTargetCopy(original.left, cloned.left, target);%0A        if (left != null) %7B%0A            return left;%0A        %7D%0A        return getTargetCopy(original.right, cloned.right, target);
 %0A   

Solve problem 1379