Function to traverse a binary encoded path and return the value encountered after traversal .
def traversePath ( root : Node , path : list ) -> int : NEW_LINE INDENT for i in range ( len ( path ) ) : NEW_LINE INDENT direction = path [ i ] NEW_LINE DEDENT DEDENT