Longest Palindrome

AtCoder
IDabc320_b
Time2000ms
Memory256MB
Difficulty
You are given a string $S$. Find the maximum length of a contiguous substring of $S$ that is a palindrome. Note that there is always a contiguous substring of $S$ that is a palindrome. ## Constraints * $S$ is a string of length between $2$ and $100$, inclusive, consisting of uppercase English letters. ## Input The input is given from Standard Input in the following format: $S$ [samples]
Samples
Input #1
TOYOTA
Output #1
5

`TOYOT`, a contiguous substring of `TOYOTA`, is a palindrome of length $5$.  
`TOYOTA`, the only length-$6$ contiguous substring of `TOYOTA`, is not a palindrome, so print $5$.
Input #2
ABCDEFG
Output #2
1

Every contiguous substring of length $1$ is a palindrome.
Input #3
AAAAAAAAAA
Output #3
10
API Response (JSON)
{
  "problem": {
    "name": "Longest Palindrome",
    "description": {
      "content": "You are given a string $S$. Find the maximum length of a contiguous substring of $S$ that is a palindrome.   Note that there is always a contiguous substring of $S$ that is a palindrome.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc320_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given a string $S$. Find the maximum length of a contiguous substring of $S$ that is a palindrome.  \nNote that there is always a contiguous substring of $S$ that is a palindrome.\n\n## Constrain...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments