Fill Wildcards to Form Smallest Palindrome
Asked at Amazon · Coding Questions · Difficulty: Medium
A string `s` contains lowercase letters and '?' wildcards. Replace each '?' with a lowercase letter to make `s` a palindrome, choosing the lexicographically smallest such palindrome. If it is impossible, return `"-1"`.
Loading the problem…