Back to problems

Delivery Cost Problem

Algorithm · Rippling · Medium

Problem Write a function that determines the total delivery charge for every customer order. Each charge is calculated as the base fee plus the per-kilometer fee multiplied by the distance associated with that order's delivery address. Input The function receives: A list of order dictionaries, each containing an order_id and an address. A dictionary that maps each delivery address to its distance in kilometers. The base delivery fee, in dollars. The extra charge for each…

Checking your access…