1
class Solution {
2
public int repeatedStringMatch(String a, String b) {
3
String copyA = a;
4
int count = 1;
5
int repeat = b.length() / a.length();
6
for (int i = 0; i < repeat + 2; i++) {
7
if (a.contains(b)) {
8
return count;
9
} else {
10
a += copyA;
11
count++;
12
}
13
}
14
return -1;
15
}
16
}

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0