remove useless for loop
This commit is contained in:
parent
18bccde2f5
commit
e2ac00420d
19
13/main.go
19
13/main.go
@ -74,18 +74,15 @@ func partTwo() {
|
|||||||
|
|
||||||
t := float64(0)
|
t := float64(0)
|
||||||
offset := buses[0].route
|
offset := buses[0].route
|
||||||
for {
|
loop:
|
||||||
loop:
|
t = t + offset
|
||||||
t = t + offset
|
offset = 1
|
||||||
offset = 1
|
for i := range buses {
|
||||||
for i := range buses {
|
if math.Remainder(t+buses[i].offset, buses[i].route) != 0 {
|
||||||
if math.Remainder(t+buses[i].offset, buses[i].route) != 0 {
|
goto loop
|
||||||
goto loop
|
} else {
|
||||||
} else {
|
offset = offset * buses[i].route
|
||||||
offset = offset * buses[i].route
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(int(t))
|
fmt.Println(int(t))
|
||||||
|
Loading…
Reference in New Issue
Block a user