Rotate String at Google

Easy65.1% acceptance

This problem has 37.5% frequency at Google.

Problem Description

Given two strings `s` and `goal`, return `true` _if and only if_ `s` _can become_ `goal` _after some number of**shifts** on_ `s`. A **shift** on `s` consists of moving the leftmost character of `s` to the rightmost position. * For example, if `s = "abcde"`, then it will be `"bcdea"` after one sh...

Read full problem and hints

Topics

Also asked at 12 companies


More Google Questions

View all Google questions