Editorial for Mock CCC '18 Contest 1 J2 - A Substring Problem
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Due to the low bounds, it is acceptable to just check every even-length substring and see if they are palindromes.
However, note that if an even length palindrome exists, then a palindrome of length 2 exists. Therefore, it suffices to check if any adjacent characters are identical.
Comments