TheHoodyGang's blog

By TheHoodyGang, history, 19 months ago, In English

please tell me why my code is not working. According to me I am doing everything correctly. question:1822E - Making Anti-Palindromes Submission :205734412

  • Vote: I like it
  • -10
  • Vote: I do not like it

»
19 months ago, # |
  Vote: I like it 0 Vote: I do not like it

The first problem with that code that you are considering strings with odd number of characters as an anti-palindrome in all the cases but that is not always true a string like aba is palindrome as we will be comparing first character with the last one and comparing the middle character with itself. After you remove that first if condition you will find that the second case in the sample is not right I think you can figure that out but if you didin't we can continue discussing the problem.