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
Prijavi se da vidiš povijest predaja
PrijavaPrijavi se da koristiš AI mentora
PrijavaTests12
Visible tests
Skriveni test 7
Skriveni test 8
Skriveni test 9
Skriveni test 10
Skriveni test 11
Skriveni test 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