I have read several solutions provided, but I don't think they consider the case when one of the target is not found.
The top vote solutions assume the target will be found in the BST, and in case when one of the target is missing in the BST, the program will return the other target found, or the potential LCA if the target is there in the tree.
But shouldn't the program return null in this situation?
Please let me know if I am understanding their code run.
several solutions I looked at: