Highest Value Palindrome

  • + 2 comments

    When I was debugging, I downloaded several test cases, but they were like thousands of characters long, inpossible to debug. I found some good short examples in the forum, and those helped with the debugging, but didn't got me far with the submissions.

    After I reimplemented, I got it right right away. I didn't even have any "special cases". Later on I checked the editorial for official answer, the explanation was falwed, but the code was pretty similar to mine.

    Two hints: - don't forget the character in the midle if length is odd - handle changes to 9s differently if a change is required at that position, or if it's an extra change of both character and mirror character