Amazon Interview Question

Trees, permutation and Combination and dfs