{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"\u003ch3\u003e Read problems statements in \u003ca target\u003d\"_blank\" href\u003d\"https://www.codechef.com/download/translated/NOV14/mandarin/PRPALN.pdf\" rel\u003d\"nofollow noreferrer noopener\"\u003eMandarin Chinese \u003c/a\u003e and \u003ca target\u003d\"_blank\" href\u003d\"https://www.codechef.com/download/translated/NOV14/russian/PRPALN.pdf\" rel\u003d\"nofollow noreferrer noopener\"\u003eRussian\u003c/a\u003e.\u003c/h3\u003e\n\n\n\u003cp\u003eGiven a string \u003cb\u003es\u003c/b\u003e. Can you make it a palindrome by deleting exactly one character? Note that size of the string after deletion would be one less than it was before. \u003c/p\u003e\n\n\u003ch3\u003eInput\u003c/h3\u003e\n\u003cp\u003eFirst line of the input contains a single integer T denoting number of test cases.\u003c/p\u003e\n\u003cp\u003eFor each test case, you are given a single line containing string \u003cb\u003e s. \u003c/b\u003e\u003c/p\u003e\n\n\u003ch3\u003eOutput\u003c/h3\u003e\n\u003cp\u003eFor each test case, print \u003cb\u003eYES\u003c/b\u003e or \u003cb\u003eNO\u003c/b\u003e depending on the answer of the problem. \u003c/p\u003e\n\n\u003ch3\u003eConstraints\u003c/h3\u003e\n\u003cp\u003e\n\u003cb\u003e Subtask 1, 35 points \u003c/b\u003e\n\u003c/p\u003e\u003cul\u003e\u003cli\u003e \u003cb\u003e1\u003c/b\u003e ≤ \u003cb\u003eT\u003c/b\u003e ≤ \u003cb\u003e100\u003c/b\u003e\u003c/li\u003e\n\u003cli\u003e\u003cb\u003e2\u003c/b\u003e ≤ \u003cb\u003e size of string s\u003c/b\u003e ≤ \u003cb\u003e1000\u003c/b\u003e\u003c/li\u003e\n\u003cli\u003e String \u003cb\u003es\u003c/b\u003e contains lowercase English alphabets (ie. from \u0027a\u0027 to \u0027z\u0027).\n\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e\n\u003cb\u003e Subtask 2, 65 points \u003c/b\u003e \n\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003cb\u003e2\u003c/b\u003e ≤ \u003cb\u003e size of string s\u003c/b\u003e ≤ \u003cb\u003e10^5\u003c/b\u003e\u003c/li\u003e\n\u003cli\u003e Sum of size of string \u003cb\u003es\u003c/b\u003e over all the input test cases won\u0027t exceed 10^6\u003c/li\u003e\n\u003cli\u003e String \u003cb\u003es\u003c/b\u003e contains lowercase English alphabets (ie. from \u0027a\u0027 to \u0027z\u0027).\n\u003c/li\u003e\u003c/ul\u003e"}},{"title":"Sample 1","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\naaa\nabc\nabdbca\nabba\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\nNO\nYES\nYES\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp\u003e\u003cb\u003eExample case 1.\u003c/b\u003e Delete any one \u0027a\u0027, resulting string is \"aa\" which is a palindrome.\u003c/p\u003e\n\u003cp\u003e\u003cb\u003eExample case 2.\u003c/b\u003e It is not possible to delete exactly one character and having a palindrome.\u003c/p\u003e\n\u003cp\u003e\u003cb\u003eExample case 3.\u003c/b\u003e Delete \u0027c\u0027, resulting string is \"abdba\" which is a palindrome. \u003c/p\u003e\n\u003cp\u003e\u003cb\u003eExample case 4.\u003c/b\u003e Delete \u0027b\u0027, resulting string is \"aba\" which is a palindrome. \u003c/p\u003e\n"}}]}