{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003chtml\u003e\n \u003chead\u003e\u003c/head\u003e\n \u003cbody\u003e\n \u003cspan class\u003d\"solution-visible-txt\"\u003e\u003c/span\u003e\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 \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 \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 \u003ch3\u003eConstraints\u003c/h3\u003e \n \u003cp\u003e \u003cb\u003e Subtask 1, 35 points \u003c/b\u003e\u003c/p\u003e \n \u003cul\u003e \n \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). \u003c/li\u003e\n \u003c/ul\u003e \n \u003cp\u003e \u003cb\u003e Subtask 2, 65 points \u003c/b\u003e \u003c/p\u003e \n \u003cul\u003e \n \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). \u003c/li\u003e\n \u003c/ul\u003e \n \u003ch3\u003eExample\u003c/h3\u003e \n \u003cpre\u003e\u003cb\u003eInput:\u003c/b\u003e\n4\naaa\nabc\nabdbca\nabba\n\n\u003cb\u003eOutput:\u003c/b\u003e\nYES\nNO\nYES\nYES\n\u003c/pre\u003e\n \u003ch3\u003eExplanation\u003c/h3\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 \u003c/body\u003e\n\u003c/html\u003e"}}]}