Almost Palindromes

More Details

A palindrome is a word, like "racecar," that is spelled the same backwards as it is forwards. The word "engage" is not a palindrome, but if we remove the letter "n" then the remaining string of letters - "egage" - uses the same sequence of characters whether it is read from left to right or right to left. We might say that "engage" is an "almost palindrome."

What Your Function Should Do

Write a function called AlmostPalindrome that takes a positive integer n and returns a list of all words in DictionaryLookup[] of length n that are not palindromes but would be palindromes if exactly one letter was removed. The list of words that your function outputs should be arranged in alphabetical order.

AlmostPalindrome[5]

More Examples

AlmostPalindrome[3]

AlmostPalindrome[4]

AlmostPalindrome[2]

AlmostPalindrome[n_Integer?Positive]:=