First non-palindrome
Easy
Execution time limit is 2 seconds
Runtime memory usage limit is 64 megabytes
In the provided string, identify the longest substring that is not a palindrome.
Input: A single string consisting of characters, with a length not exceeding 10^5 characters. Output: The length of the longest non-palindromic substring. If no such substring can be found, output -1.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 18%