We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 33a3c82 commit 5ed3b4fCopy full SHA for 5ed3b4f
scripts/algorithms/R/Repeated Substring Pattern/Repeated Substring Pattern.java
@@ -1,10 +1,11 @@
1
+// Runtime: 324 ms (Top 17.74%) | Memory: 165.9 MB (Top 16.84%)
2
class Solution {
-
3
+
4
public boolean repeatedSubstringPattern(String s) {
5
String temp="";
6
for(int i=0 ;i<s.length()/2 ;i++){
7
temp+=s.charAt(i);
8
9
if(s.length()%temp.length()==0) {
10
int times_repeat= s.length()/temp.length();
11
StringBuilder str = new StringBuilder();
@@ -16,4 +17,4 @@ public boolean repeatedSubstringPattern(String s) {
16
17
}
18
return false;
19
-}
20
+}
0 commit comments