public static TreeNode lowestCommonAncestor(TreeNode root, TreeNode A, TreeNode B) {
        // write your code here
        TreeNode[]rel=new TreeNode[1];
        lcaHelper(root,A,B,rel);
        return rel[0];
    }