Google interview question

Permutation, subset, intervals