تابعی بنویسید که دو پارامتر دارد: orders
و cost
. هر سفارشی که بیشتر از مقدار cost
باشد را برگرداند.
نمونه ورودی و خروجی
ExpensiveOrders({ "a": 3000, "b": 200, "c": 1050 }, 1000) ➞ { "a": 3000, "c": 1050 }
ExpensiveOrders({ "Gucci Fur": 24600, "Teak Dining Table": 3200, "Louis Vutton Bag": 5550, "Dolce Gabana Heels": 4000 }, 20000) ➞ { "Gucci Fur": 24600 }
ExpensiveOrders({ "Deluxe Burger": 35, "Icecream Shake": 4, "Fries": 5 }, 40) ➞ {}
Assert.Equal(new Dictionary{ { "a", 3000 }, { "c", 1050 } }, Backendbaz.ExpensiveOrders(new Dictionary { { "a", 3000 }, { "b", 200 }, { "c", 1050 } }, 1000)); Assert.Equal(new Dictionary { { "Gucci Fur", 24600 } }, Backendbaz.ExpensiveOrders(new Dictionary { { "Gucci Fur", 24600 }, { "Teak Dining Table", 3200 }, { "Louis Vutton Bag", 5550 }, { "Dolce Gabana Heels", 4000 } }, 20000)); Assert.Equal(new Dictionary (), Backendbaz.ExpensiveOrders(new Dictionary { { "Deluxe Burger", 35 }, { "Icecream Shake", 4 }, { "Fries", 5 } }, 40));
نظرات