We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Because this is special palindrome string, case 2: All characters except the middle one are the same, e.g. aadaa. So there is no need to consider i-2 and i+2. two neibors should be same.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Special String Again
You are viewing a single comment's thread. Return to all comments →
Because this is special palindrome string, case 2: All characters except the middle one are the same, e.g. aadaa. So there is no need to consider i-2 and i+2. two neibors should be same.