GlobalLogic Interview Question

Possible permutations of a string