Given two strings s and goal, return true if and only if s can become goal after some number of shifts. A shift moves the leftmost character of s to the rightmost position, so "abcde" becomes "bcdea".
Given two strings s and goal, return true if and only if s can become goal after some number of shifts. A shift moves the leftmost character of s to the rightmost position, so "abcde" becomes "bcdea".
Example 1:
Input: {"s":"abcde","goal":"cdeab"}
Output: true
Constraints:
1≤s.length,goal.length≤100
s and goal consist of lowercase English letters.
Test Cases
Input (Stdin)
Expected Output (Stdout)
Execution Result
Run code to see results.
Input
arr ={"s":"abcde","goal":"cdeab"}
A shift only moves characters around, so it never changes the length. Compare len(s) = 5 with len(goal) = 5.