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
Jelentkezz be a beküldési előzmények megtekintéséhez
BejelentkezésJelentkezz be az MI-mentor használatához
BejelentkezésTests12
Visible tests
Rejtett teszt 7
Rejtett teszt 8
Rejtett teszt 9
Rejtett teszt 10
Rejtett teszt 11
Rejtett teszt 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