ServiceNow interview question

Find all permutation of given string by the user