Kodewick
Start learning →
Starter←→0 / 100

Pick a checkout

#042StarterLists3 min

The supermarket has a few checkouts, and the list says how many people wait at each one, numbered from 1. Write best_counter(queues) to return the number of the shortest queue. On a tie, pick the lower number.

Examples
best_counter([5, 2, 7])→2
best_counter([0, 3])→1
best_counter([4, 1, 6, 1])→2
main.py
def best_counter(queues):
    fewest = min(queues)
    # your code here: where fewest sits, plus 1 for the checkout number
    return 0
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.