LeetCode 796. 旋转字符串

题目描述

🔥 796. 旋转字符串

image-20230312172416619

思路分析

思路描述

参考代码

1
2
3
4
5
6
7
func rotateString(s string, goal string) bool {
	if len(s) != len(goal) {
		return false
	}
	s = s + s
	return strings.Contains(s, goal)
}

🍏 点击查看 Java 题解

1
write your code here
本文作者:
本文链接: https://hgnulb.github.io/blog/78865117
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处!