public boolean repeatedSubstringPattern(String s) {//48ms
return s.matches("(\\w+)\\1+");
}
public static boolean repeatedSubstringPattern(String s) {
String str = s + s;
return str.substring(1, str.length() - 1).contains(s);
}
public boolean repeatedSubstringPattern(String s) {//48ms
return s.matches("(\\w+)\\1+");
}
public static boolean repeatedSubstringPattern(String s) {
String str = s + s;
return str.substring(1, str.length() - 1).contains(s);
}