#t190. 字符串移位包含问题
字符串移位包含问题
Cyclic-Shift Substring
Problem Description
For a string, one cyclic shift is defined as moving its first character to the end to form a new string.
Given two strings and , determine whether one of them is a substring of the other string after several cyclic shifts. For example, CDAA is a substring of BCDAA, which is obtained from AABCD by two shifts; whereas ABCD and ACBD cannot yield, by any number of shifts, a new string of which one is a substring.
Input Format
One line containing two strings separated by a single space. The strings contain only letters and digits, and have length at most .
Output Format
If one string is a substring of the other's shifted string, output true; otherwise output false.
Sample Input
AABCD CDAA
Sample Output
true