#C7372. Check String Rotation

    ID: 51236 Type: Default 1000ms 256MiB

Check String Rotation

Check String Rotation

Given two strings s1 and s2, determine whether s2 can be obtained by performing a series of shift operations on s1. A shift operation moves the first character of the string to its end.

For example, if s1 = "abcde", one shift produces "bcdea", and subsequent shifts yield "cdeab", "deabc", "eabcd", and then back to "abcde". Note that if the lengths of s1 and s2 differ, then s2 cannot be a rotation of s1.

inputFormat

The input is read from standard input (stdin). It consists of two lines: the first line contains the string s1, and the second line contains the string s2.

outputFormat

Output to standard output (stdout) the word "True" if s2 is a rotation of s1 via shift operations; otherwise, output "False".## sample

abcde
cdeab
True

</p>