Bloomberg Interview Question

LeetCode style binary tree problem