Solve The Love Letter Mystery Problem on Hacker Rank Using C#,
James found a love letter that his friend Harry has written to his girlfriend. James is a prankster, so he decides to meddle with the letter. He changes all the words in the letter into palindromes.
To do this, he follows two rules:
1.He can only reduce the value of a letter by 1, i.e. he can change d to c, but he cannot change c to d or d to b.
2.The letter a may not be reduced any further.
Each reduction in the value of any letter is counted as a single operation. Find the minimum number of operations required to convert a given string into a palindrome.
For example, given the string s= cde , the following two operations are performed: cde → cdd → cdc.
If you want to solve this type of problem next time own their own then please watch this video till the end, you may solve this problem just copying the code but copying code is not perfect solution.
After watching this video if you still facing any challenges or issue please feel free to write to us on [email protected] or in comment section
We love to hear your query and we will back to you as soon as possible.
Happy Learning
Codes Evidence