Rotate String
Example 1:
Input: A = 'abcde', B = 'cdeab'
Output: true
Example 2:
Input: A = 'abcde', B = 'abced'
Output: falseclass Solution {
public boolean rotateString(String A, String B) {
if(A.length() != B.length())
return false;
A = A+A;
if(A.toLowerCase().contains(B.toLowerCase())){
return true;
}
return false;
}
}Last updated