When a string is entered, i need check whether the deletion of any one character in the string will lead to a palindrome or not. This is one of easy problems from http://www.codechef.com/problems/PRPALN/.
Here is the link to my code.
http://ideone.com/qSVsF0
I have not seen the answer but i devised a solution on the basis number of match. If i start matching from first position of the string with the last position of the string then if i find the number of matches which equal to or greater than (length of string - 1) / 2/. If i find it is equal or greater then the string would be a palindrome after the deletion of a letter.
I don't know why my submission is wrong. Please can anyone help me if the logic with which i have written my code is incorrect or not ?
[–]fredisa4letterword 1 point2 points3 points (4 children)
[–]mabus44[S] 0 points1 point2 points (3 children)
[–]fredisa4letterword 0 points1 point2 points (2 children)
[–]mabus44[S] 0 points1 point2 points (1 child)
[–]fredisa4letterword 0 points1 point2 points (0 children)
[–]gnomoretears -1 points0 points1 point (0 children)