Given a string s, you are allowed to convert it to a palindrome by adding characters in front of it. Your task is to find and return the shortest palindrome that can be obtained by performing this transformation.
Input/Output Format
Input: A single string s (1 ≤ s.length ≤ 1000), where s consists of lowercase English letters.
Output: A single string representing the shortest palindrome that can be formed.
Examples
Example 1
Input: "aacecaaa"
Output: "aaacecaaa"
Example 2
Input: "abcd"
Output: "dcbabcd"
Implementation
Your solution should be placed in the /app/ directory.
Important: place your implementation at /app/solution.py so the verifier can run it.