Untitled
unknown
plain_text
a year ago
322 B
9
Indexable
func TryFinish(car *Car, distance int) string {
approximate_distance := distance
if distance%2 != 0 {
approximate_distance -= 1
}
if car.battery*2 < approximate_distance {
car.battery = 0
return ""
} else {
car.battery -= distance / 2
return fmt.Sprintf("%.2f", float64(distance)/float64(car.speed))
}
}Editor is loading...
Leave a Comment