carloscn / carloscn/structstudy
leetcode796:旋转字符串(rotate-string)
Open
Level-easy
一般问题
字符串
- Dominant language
- C
- Stars
- 4
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
### 问题描述
给定两个字符串, s 和 goal。如果在若干次旋转操作之后,s 能变成 goal ,那么返回 true 。
s 的 旋转操作 就是将 s 最左边的字符移动到最右边。
例如, 若 s = 'abcde',在旋转一次之后结果就是'bcdea' 。
示例 1:
输入: s = "abcde", goal = "cdeab"
输出: true
示例 2:
输入: s = "abcde", goal = "abced"
输出: false
提示:
1 <= s.length, goal.length <= 100
s 和 goal 由小写英文字母组成
来源:力扣(LeetCode)
链接:https://leetcode.cn/problems/rotate-string
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.