Simplotel interview question

Data structures, permutation.