You are given two strings s and goal.
Return true if and only if s can become goal after performing some number of left rotations.
A left rotation (shift) means removing the first character of s and appending it to the end.
Example:
"abcde" → "bcdea" → "cdeab" → …
To determine if goal is a rotation of s, notice that any rotation of s will always appear as a substring of s + s.
Input: s = "abcde", goal = "cdeab"
Output: true
Input: s = "abcde", goal = "abced"
Output: false
Accepted:
Submission: