About Task 4, I am wondering if the supplied hint suggests at an alternate solution? Or looking to understand how the hint relates to the solution.
Check if a remote control car can finish a race
- Remember the car has a method to retrieve the distance it has driven
Myself and every solution I could find solved this Task, as follows:
func (c *Car) CanFinish(trackDistance int) bool {
return c.battery / c.batteryDrain * c.speed >= trackDistance
}
Does the hint intend to nudge us towards an algorithm that either uses c.distance, or DisplayDistance()? Or am I overthinking the hint?
I tried return trackDistance < c.distance
(which is wrong) but showing this as an example of trying to use “distance”.
Cross-posted (first in Discord)