totalTime to 0.points except the last one.
points[i] and the next point points[i+1], calculate the differences xDiff and yDiff in x and y coordinates respectively.xDiff and yDiff.totalTime.totalTime as the minimum time to visit all points.