Bloomberg Interview Question

valid binary tree