Find LCA of binary tree https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/
discussed approach with interviewer with storing data into 2 array and
then iterate on max array and checking the common element. I wasnt familier with this question earlier (might be my bad).
See leetcode for optimised solution