#P10992. [蓝桥杯 2023 国 Python A] 最长同类子串
[蓝桥杯 2023 国 Python A] 最长同类子串
Problem Description
For two strings of the same length, if for any , the two conditions and are either both true or both false at the same time, then we call a pair of same-type strings. For example, aabab and xxkxk are a pair of same-type strings, while abcde and abcdd are not.
Given , find the largest possible such that each contain a substring of length , denoted , and are a pair of same-type strings.
Input Format
The input consists of two lines. Each line contains a string, representing and .
Output Format
Output one line containing an integer , representing the answer.
aaaba
yxyy
3
Hint
For of the testdata, .
For of the testdata, .
For all testdata, , and contain only lowercase English letters.
Translated by ChatGPT 5