Goldman Sachs Interview Question

Subset of binary tree