Block interview question

Permute a string