Tap here to switch tabs
Problem
Submissions

Problem: Rotate String

med
30 min
Try to solve the Rotate String problem.

Statement

Given two strings s and goal, determine whether goal can be obtained by rotating s. A rotation moves some number of characters from the beginning of s to the end while keeping their order.

Return true if goal is a rotation of s, otherwise return false.

Constraints:

  • 1≤1 \leq s.length, goal.length ≤100\leq 100

  • s and goal consist of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Rotate String

med
30 min
Try to solve the Rotate String problem.

Statement

Given two strings s and goal, determine whether goal can be obtained by rotating s. A rotation moves some number of characters from the beginning of s to the end while keeping their order.

Return true if goal is a rotation of s, otherwise return false.

Constraints:

  • 1≤1 \leq s.length, goal.length ≤100\leq 100

  • s and goal consist of lowercase English letters.