DEV Community

Discussion on: Daily Challenge #74 - Free Pizza

Collapse
teaglebuilt profile image
dillan teagle

Python solution

def rewarder(customers, orders, price):
    eligible = set()
    for key, value in customers.items():
        number_of_occurences = sum(num > price for num in value)
        if number_of_occurences >= orders:
            eligible.add(key)

    return eligible


x = rewarder(customers, min_orders, min_price)
print(x)