Palindrome Index

  • + 1 comment

    I have a question, how does this code ensure that when:

    s[counter] != s[len - 1 - counter] is true

    and

    s[counter] == s[len - 2 - counter] is not true

    the rest of the string inside [counter, len-2-counter] is in fact a palindrome?