1
class Solution {
2

3
public boolean repeatedSubstringPattern(String s) {
4
String temp = "";
5
for (int i = 0; i < s.length() / 2; i++) {
6
temp += s.charAt(i);
7

8
if (s.length() % temp.length() == 0) {
9
int times_repeat = s.length() / temp.length();
10
StringBuilder str = new StringBuilder();
11
for (int j = 0; j < times_repeat; j++) {
12
str.append(temp);
13
}
14
if (str.toString().equals(s)) return true;
15
}
16
}
17
return false;
18
}
19
}

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0