Applied Materials interview question

Permutation of a string in Java