Compass Interview Question

Leetcode medium question on a binary tree