Calculate the difference between the largest and smallest DELIVERY orders for each currency. Return the result for each currency, sorted in ascending order of the difference.
/**
* Returns a map of {currency (sorted by difference) – difference between the largest and smallest DELIVERY order for that currency}.
* If there is only one order for a currency, the difference is 0.
* Example input:
* [
* Order(DELIVERY, "EUR", 2000),
* Order(DELIVERY, "USD", 15),
* Order(DELIVERY, "RUB", 200),
* Order (PICKUP, "RUB", 1250),
* Order (DELIVERY, "USD", 35),
* Order (PICKUP, "USD", 55),
* Order (DELIVERY, "RUB", 100)
* ]
*
* Expected output:
* ["EUR" -> 0.0, "USD" -> 20.0, "RUB" -> 100.0]
*
*/
Map<String, Double> getMaxMinusMinDeliveryMapByCurrency(List<OrderData> orderDataList) {
}
middle+