A. Mr. Kitayutas Gift(暴力求加一个字符是否构成回文字符)

Mr. Kitayuta has kindly given you a stringsconsisting of lowercase English letters. You are asked to insert exactly one lowercase English letter intosto make it a palindrome. Apalindromeis a string that reads the same forward and backward. For example, "noon", "testset" and "a" are all palindromes, while "test" and "kitayuta" are not.

You can choose any lowercase English letter, and insert it to any position ofs, possibly to the beginning or the end ofs. You have to insert a letter even if the given string is already a palindrome.

If it is possible to insert one lowercase English letter intosso that the resulting string will be a palindrome, print the string after the insertion. Otherwise, print "NA" (without quotes, case-sensitive). In case there is more than one palindrome that can be obtained, you are allowed to print any of them.

,一个人最大的破产是绝望,最大的资产是希望。

A. Mr. Kitayutas Gift(暴力求加一个字符是否构成回文字符)

相关文章:

你感兴趣的文章:

标签云: