标签:pre div 题目 highlight elf self == test pytho
这是程序员面试金典里面的一个题目。判断B是否是A旋转得到的,只要判断B是否是A+A的字串即可。
class Solution(object):
def rotateString(self, A, B):
"""
:type A: str
:type B: str
:rtype: bool
"""
return len(A)==len(B) and B in A+A
标签:pre div 题目 highlight elf self == test pytho
原文地址:https://www.cnblogs.com/learning-c/p/9280538.html