Rotate String
看一个字符串B不是左旋后的A. 只需要把A复制一下, 然后看其中有没有B即可.
class Solution {
public boolean rotateString(String A, String B) {
if(A.length() != B.length()) // must has same length
return false;
else {
String C = A + A;
if(C.contains(B))// rotate and same
return true;
}
return false;
}
}