Skip to content

Commit 4384711

Browse files
committed
reformatted
1 parent 59cadd5 commit 4384711

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

problem013/problem013.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ func Run(input string, maxDistinctCount uint) uint {
99
characterCount[substringEndsWith] += 1
1010
for len(characterCount) > int(maxDistinctCount) {
1111
substringStartsWith := input[substringStartsAt : substringStartsAt+1]
12-
characterCount[substringStartsWith] -= 1
13-
if characterCount[substringStartsWith] == 0 {
12+
if characterCount[substringStartsWith] > 1 {
13+
characterCount[substringStartsWith] -= 1
14+
} else {
1415
delete(characterCount, substringStartsWith)
1516
}
1617
substringStartsAt++

0 commit comments

Comments
 (0)