Amazon Interview Question

A hard lc BST problem