Barclays interview question

String palindrome and permutation formula and generation