Your question is Queueing Shipping Types. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Fashion Nova needs to arrange fulfillment orders in shipping priority order. Given an arrival list and an explicit priority ranking, return a new queue with higher-priority shipping types first while preserving the original arrival order among orders with the same type.
Do not modify the input list. You may assume every order uses a shipping type present in priority.
Implement queue_shipping_orders(orders, priority).
orders is a list of dictionaries. Each dictionary contains a string key shipping_type and may contain other fields such as order_id.priority is a list of distinct shipping type strings, ordered from highest priority to lowest priority.priority.def queue_shipping_orders(orders, priority):