Jim and the Orders

  • + 0 comments

    Python Solution using key-value pairs -

    def jimOrders(orders):
        # Write your code here
        customer_time = {i + 1: sum(orders[i]) for i in range(len(orders))}
        
        sorted_orders = sorted(customer_time, key=lambda x: customer_time[x])
        
        return sorted_orders