SDE Path

Check if a String Rotation of Another

Easy

Check if a String Rotation of Another

Determine whether string B is a rotation of string A.

Input format

Two lines, each containing one lowercase string.

Output format

Print true if the second string is a rotation of the first, otherwise false.

Constraints

  • Values fit in a 64-bit signed integer
  • Trailing whitespace and a trailing newline are ignored by the judge

Read from stdin, write to stdout. Sample cases below show the exact format.

Sample cases

Example 1
Input
abcde cdeab
Expected output
true
Example 2
Input
abcde abced
Expected output
false