2697. Lexicographically Smallest Palindrome
You are given a string
sconsisting of lowercase English letters, and you are allowed to perform operations on it. In one operation, you can replace a character inswith another lowercase English letter.Your task is to make
sa palindrome with the minimum number of operations possible. If there are multiple palindromes that can be made using the minimum number of operations, make the lexicographically smallest one.A string
ais lexicographically smaller than a stringb(of the same length) if in the first position whereaandbdiffer, stringahas a letter that appears earlier in the alphabet than the corresponding letter inb.Return the resulting palindrome string.
1 | class Solution { |