Minimum steps to palindrome
A string is a palindrome if it is equal to its reverse.
(= "racecar" (str/reverse "racecar")) ;=> true, so palindrome
Your task is to write a function that adds a minimum of letters to the end of a string to make it a palindrome.
Examples
(->palindrome "race") ;=> "racecar"
(->palindrome "mad") ;=> "madam"
(->palindrome "mirror") ;=> "mirrorrim"
Note: the generated string does not have to be a real English word.
Thanks to this site for the challenge idea where it is considered Expert in JavaScript. The problem has been modified from the original.
Please submit your solutions as comments on this gist.