#C7877. String Rotation Verification
String Rotation Verification
String Rotation Verification
Given two strings s1 and s2, determine whether s2 is a rotation of s1. A string s2 is considered a rotation of s1 if it can be obtained by moving a prefix of s1 to its end.
Formally, if the length of s1 is \(n\), then s2 is a rotation of s1 if there exists an integer \(k\) with \(0 \le k < n\) such that:
\( s_2 = s_1[k:] + s_1[:k] \)
You are required to read the input from stdin and output the result to stdout as described below.
inputFormat
The input consists of two lines:
The first line contains the string s1. The second line contains the string s2.
outputFormat
Output a single line with either "True" if s2 is a rotation of s1, or "False" otherwise.## sample
abc
bca
True