Passing Students

Easy · rating 850 · arrays

A class sat an exam. The first line contains n. The second line contains n scores (0–100). Print how many students scored 60 or above (a passing grade).

Editorial

Passing Students counts how many exam scores reach the passing mark (60). A single scan with one comparison does it.

print(sum(1 for s in scores if s >= 60))

Complexity

Time: O(n). Space: O(1).

Open Passing Students in Code Arena →