word of lowercase English letters. In one operation you may replace any letter with any other lowercase English letter.
Turn word into a palindrome using as few operations as possible. If several palindromes need that same minimum, return the one that comes first alphabetically (lexicographically).word="river" → 'rever'
The outer pair r/r already matches; the pair i/e differs, so i becomes the smaller e. One change gives "rever".
word="zebra" → 'aebea'
The pairs z/a and e/r both differ; each keeps its smaller letter, a and e, giving "aebea".
word="noon" → 'noon'
The string is already a palindrome, so nothing changes.
word consists of lowercase English lettersword="river"
'rever'
Run checks the first 3 tests in your browser. Submit checks all 219 tests on the server, hidden ones included.