Uber Interview Question

binary tree