Break a Palindrome to the Lexicographically Smallest Non-Palindrome
Task
Given a palindromic string of lowercase English letters (length 1 to 1,000), replace exactly one character so that:
-
The result is no longer a palindrome, and
-
It is the lexicographically smallest possible string among all valid one-character replacements.
Return the resulting string, or an empty string if it cannot be done.
What to Provide
-
Describe your algorithm.
-
Call out key edge cases (e.g., single-character input).
-
Analyze time and space complexity.