public static TreeNode getLCA2(TreeNode root, TreeNode p, TreeNode q) {
        if(root == null || p == null || q == null) return null;
        if(root == p || root == q) return root;

        TreeNode left = getLCA2(root.left, p, q);
        TreeNode right = getLCA2(root.right, p, q);
        if(left != null && right != null) return root;
        return left != null ? left : right;
    }