Problem Statement | |||||||||||||
A palindrome is a string that reads the same from left to right as it does from right to left. Given a String s, return the shortest palindrome that can be produced by adding zero or more characters to the right end of s. There is always one unique answer. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
| - | s will contain between 1 and 50 characters, inclusive. | ||||||||||||
| - | Each character of s will be a lowercase letter ('a'-'z'). | ||||||||||||
Examples | |||||||||||||
| 0) | |||||||||||||
| |||||||||||||
| 1) | |||||||||||||
| |||||||||||||
| 2) | |||||||||||||
| |||||||||||||
| 3) | |||||||||||||
| |||||||||||||
| 4) | |||||||||||||
| |||||||||||||