Uber: Possible path in a binary tree

Problem:

Approach: