## Task
Given a string, add the fewest number of characters possible from the front or back to make it a palindrome.
## Example
For the input `cdcab`, the output should be `bacdcab`
## Input/Output
Input is a string consisting of lowercase latin letters with length 3 <= str.length <= 10
The output is a palindrome string satisfying the task.
For s = `ab` either solution (`aba` or `bab`) will be accepted.
def build_palindrome(s):
    l = len(s)
    left = next(l-i for i in range(l, 0, -1) if s[:i] == s[i-1::-1])
    right = next(l-i for i in range(l, 0, -1) if s[-i:] == s[:-i-1:-1] or left == l-i)
    return s[:-left-1:-1] + s if left <= right else s + s[right-1::-1]
def build_palindrome(s):
    l = len(s)
    left = next(l-i for i in range(l, 0, -1) if s[:i] == s[i-1::-1])
    right = next(l-i for i in range(l, 0, -1) if s[-i:] == s[:-i-1:-1] or left == l-i)
    return s[:-left-1:-1] + s if left <= right else s + s[right-1::-1]