Skip to content

Commit 99a0c2d

Browse files
Dev-06-06Copilot
andauthored
Update exercises/1000_programs/medium/1870_min_speed.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent c1c7df1 commit 99a0c2d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎exercises/1000_programs/medium/1870_min_speed.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def minSpeedOnTime(dist, hour):
1212
# Calculate time taken at speed 'mid'
1313
time = 0
1414
for i in range(len(dist) - 1):
15-
time += math.ceil(dist[i] / mid)
15+
time += (dist[i] + mid - 1) // mid
1616
# Last train doesn't need to wait for integer hour
1717
time += dist[-1] / mid
1818
if time <= hour:

0 commit comments

Comments
 (0)