AmazonOA #251
Lexicographically Smallest Palindrome Possible
估计中等评测数据准备中,可先阅读题面
Giv
Constraints
A mysterious untelling for now As always, will add once find out
Example 1
Input:
s = "a?rt???"
Output:
"aartraa"
Explanation: Question marks can be replaced by a, r, a, a and we can make it palindrome.
Example 2
Input:
s = "bx??tm"
Output:
"-1"
Explanation: No character can be added to make it a palindrome.
Example 3
Input:
s = "ai?a??u"
Output:
"aaiuiaa"
Explanation: '?' is replaced by a, a and i and characters are rearranged to make it a palindrome.