Skip to content

Commit d724ebe

Browse files
refactor 686
1 parent 204e107 commit d724ebe

File tree

1 file changed

+1
-14
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+1
-14
lines changed

src/main/java/com/fishercoder/solutions/_686.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,6 @@
33
import java.util.HashSet;
44
import java.util.Set;
55

6-
/**
7-
* 686. Repeated String Match
8-
*
9-
* Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it.
10-
* If no such solution, return -1.
11-
* For example, with A = "abcd" and B = "cdabcdab".
12-
* Return 3, because by repeating A three times (“abcdabcdabcd”),
13-
* B is a substring of it; and B is not a substring of A repeated two times ("abcdabcd").
14-
15-
Note:
16-
The length of A and B will be between 1 and 10000.
17-
*/
18-
196
public class _686 {
207
public static class Solution1 {
218
public int repeatedStringMatch(String A, String B) {
@@ -43,7 +30,7 @@ public static class Solution2 {
4330
/**
4431
* Time: O(N(N+M))
4532
* Space: O(N + M)
46-
* */
33+
*/
4734
public int repeatedStringMatch(String A, String B) {
4835
int count = 1;
4936
StringBuilder sb = new StringBuilder(A);

0 commit comments

Comments
 (0)