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.
Palindrome means that the symmetric positions of the string should be same...so the main aim of this problem is to make the symmetric positions same......therefore acc to the qstn you can change the character only with the ascii value just greater than the above value...that is if you want to change c->a u basically do c->b and b->a,here it is changing with the ascii value of 1+1=2 so u have to make 2 changes to make the alphabet c to a,to be short it is nothing but the ascii diff between c and a i.e 99-97=2
Think in this way and check all the symmetric characters and make them equal
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
The Love-Letter Mystery
You are viewing a single comment's thread. Return to all comments →
Palindrome means that the symmetric positions of the string should be same...so the main aim of this problem is to make the symmetric positions same......therefore acc to the qstn you can change the character only with the ascii value just greater than the above value...that is if you want to change c->a u basically do c->b and b->a,here it is changing with the ascii value of 1+1=2 so u have to make 2 changes to make the alphabet c to a,to be short it is nothing but the ascii diff between c and a i.e 99-97=2 Think in this way and check all the symmetric characters and make them equal