Class Cancellation

The professor will only start class if enough students arrive by the beginning. The function angry_professor receives the minimum required number of students k and a list of arrival times a: a value of 0 or less means the student arrived on time. Count how many students made it on time and return YES if the class is cancelled, otherwise return NO.

Примеры

Ввод
3, [-1, -3, 4, 2]
Вывод
"YES"
Ввод
2, [0, -1, 2, 1]
Вывод
"NO"
Ввод
1, [5]
Вывод
"YES"

Нужно реализовать

def angry_professor(k: int, a: list[int]) -> str:

Теги

arraymath
PostgreSQLv16

Koodin suorituksen tulos näkyy tässä

Tests12
Visible tests
Piilotettu testi 7
Piilotettu testi 8
Piilotettu testi 9
Piilotettu testi 10
Piilotettu testi 11
Piilotettu testi 12

They run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.

Focus radio
Paused · SomaFM · Fluid