Comcast interview question

Permutations