Google Interview Question

Permutation, subset, intervals