public class Solution { public bool RotateString(string A, string B) { string temp = A; int len = A.Length; int lenB = B.Length; if (len != lenB) { return false; } if (len == 0) { return true; } for (int i = 0; i < len; i++) { var prefix = A.Substring(0, i); var next = A.Substring(i); if (B.Equals(next + prefix)) { return true; } } return false; } }