题解 | #旋转字符串# | C++
旋转字符串
https://www.nowcoder.com/practice/80b6bb8797644c83bc50ac761b72981c
class Solution {
public:
/**
* 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
*
* 旋转字符串
* @param A string字符串
* @param B string字符串
* @return bool布尔型
*/
bool solve(string A, string B) {
if (A.length() != B.length()) return false;
return (A+A).find(B) != std::string::npos;
}
};
腾讯公司福利 1143人发布