Persistent Systems Interview Question

Permutation of string code working.