Oracle Interview Question

Leetcode hard, tree traversal question.