Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0d32f4f

Browse files
author
Shuo
authored
Merge pull request #705 from openset/develop
Update: Repeated String Match
2 parents 6130d8d + 2cdd5ac commit 0d32f4f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎problems/repeated-string-match/repeated_string_match.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ package problem686
33
import "strings"
44

55
func repeatedStringMatch(A string, B string) int {
6-
a, count := A, len(B)/len(A)
6+
count := len(B)/len(A)
77
if len(B)%len(A) > 0 {
88
count++
99
}
1010
for times := 0; times < 2; times++ {
11-
a = strings.Repeat(A, count)
11+
a := strings.Repeat(A, count)
1212
if strings.Index(a, B) != -1 {
1313
return count
1414
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /