Meta interview question

Valid Palindrome 2, Next Permutation