Given a binary tree and data value of two of its nodes. Find the number of turns needed to reach from one node to another in the given binary tree
Example 1
Input: Tree = [1, 2, 3, 4, 5, 6, 7, 8, N, 9, 10], first node = 5, second node = 10
Output: 4
Explanation: Turns will be at 2, 1, 3, 6.
Example 2
Input: Tree = [1, 2, 3, 4, 5, 6, 7, 8, N, 9, 10], first node = 1, second node = 4
Output: 0
Explanation: No turns required
Sign in to write, run, and submit your solution against the full test suite.