Problem Β· String
Lexicographically Smallest Palindrome Possible π
Learn this problemProblem statement
Given a String, return the lexicographically smallest palindrome possible or -1.
Function
getSmallestPalindrome(s: String) β StringExamples
Example 1
s = "a?rt???"return = "aartraa"Question marks can be replaced by a, r, a, a and we can make it palindrome.
Example 2
s = "bx??tm"return = "-1"No character can be added to make it a palindrome.
Example 3
s = "ai?a??u"return = "aaiuiaa"'?' is replaced by a, a and i and characters are rearranged to make it a palindrome.
Constraints
A mysterious untelling for now π§ As always, will add once find outMore Amazon problems
- Secure Maximum DeliveriesOA Β· Seen Jul 2026
- Find Median from Data StreamONSITE INTERVIEW Β· Seen Jul 2026
- Handwritten SigmoidPHONE SCREEN Β· Seen Jul 2026
- Handwritten SoftmaxPHONE SCREEN Β· Seen Jul 2026
- Koko Eating BananasONSITE INTERVIEW Β· Seen Jul 2026
- Loyal Customers Across Two DaysONSITE INTERVIEW Β· Seen Jul 2026
- Maximum System Memory CapacityOA Β· Seen Jul 2026
- Package Delivery SystemOA Β· Seen Jul 2026