Skip to content

Commit 5ed3b4f

Browse files
committed
Runtime: 324 ms (Top 17.74%) | Memory: 165.9 MB (Top 16.84%)
1 parent 33a3c82 commit 5ed3b4f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/algorithms/R/Repeated Substring Pattern/Repeated Substring Pattern.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
// Runtime: 324 ms (Top 17.74%) | Memory: 165.9 MB (Top 16.84%)
12
class Solution {
2-
3+
34
public boolean repeatedSubstringPattern(String s) {
45
String temp="";
56
for(int i=0 ;i<s.length()/2 ;i++){
67
temp+=s.charAt(i);
7-
8+
89
if(s.length()%temp.length()==0) {
910
int times_repeat= s.length()/temp.length();
1011
StringBuilder str = new StringBuilder();
@@ -16,4 +17,4 @@ public boolean repeatedSubstringPattern(String s) {
1617
}
1718
return false;
1819
}
19-
}
20+
}

0 commit comments

Comments
 (0)