public TreeNode getAncestor(TreeNode root, TreeNode node1, TreeNode node2) {
		if (root == null || root == node1 || root == node2) {
			return root;
		}

		// Divide
		TreeNode left = getAncestor(root.left, node1, node2); // find the lca in root.left
		TreeNode right = getAncestor(root.right, node1, node2); // find the lca in root.right

		// Conquer
		if (left != null && right != null) {
			// if both left and right can find node
			// then root is an ancestor of node1 and node2
			return root;
		}
		if (left != null) {
			return left;
		}
		if (right != null) {
			return right;
		}
		return null;
	}