Lowest common ancestor (binary tree )

https://hack.codingblocks.com/contests/c/457/506
https://ide.codingblocks.com/#/s/19340

Heyy ur code is giving wrong output for
10 true 20 true 40 false false true 50 false false true 30 true 60 false false true 73 false false
40 50
Try to make a separate function for LCA and first check if the first element is present in the left tree or not if no then retrun -1, else check wheather second element is present in left tree or right tree and return as per the case .For any query , go through this code
https://ide.codingblocks.com/#/s/19343