Skip to content

Instantly share code, notes, and snippets.

@gamikun
Created June 29, 2016 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gamikun/ac93e67534e9075863dbc4842466644c to your computer and use it in GitHub Desktop.
Save gamikun/ac93e67534e9075863dbc4842466644c to your computer and use it in GitHub Desktop.
CodeFights.UberBot.fareEstimator
def fareEstimator(ride_time, ride_distance, cost_per_minute, cost_per_mile):
estimations = []
for i, rtime in enumerate(ride_time):
rdist = ride_distance[i]
permin = cost_per_minute[i]
permile = cost_per_mile[i]
est = (rtime * permin) + (permile * rdist)
estimations.append(est)
return estimations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment