Skip to content

Commit 710feb4

Browse files
committed
feat(angch/2024-07): use int instead of str
1 parent 4ab6c77 commit 710feb4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

angch/2024-07/main.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ func day7(file string) (part1, part2 int) {
4040
start *= n[i]
4141
} else {
4242
ispart2 = true
43-
vv := fmt.Sprintf("%d%d", start, n[i])
44-
v, _ := strconv.Atoi(vv)
45-
start = v
43+
for range len(rs[i]) {
44+
start *= 10
45+
}
46+
start += n[i]
4647
}
4748
}
4849
if start == testv {

0 commit comments

Comments
 (0)