题解 | #旋转字符串# | Rust
旋转字符串
https://www.nowcoder.com/practice/80b6bb8797644c83bc50ac761b72981c
struct Solution{ } impl Solution { fn new() -> Self { Solution{} } /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 旋转字符串 * @param A string字符串 * @param B string字符串 * @return bool布尔型 */ pub fn solve(&self, A: String, B: String) -> bool { if A.len() != B.len() { return false; } return (A.clone() + &A).contains(&B); } }