ServiceNow Interview Question

Find all permutation of given string by the user