Justworks Interview Question

Leetcode question. They ask you to traverse a binary tree in various directions.