Amazon Interview Question

Basic tree, Hash set problems