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).
Related problems
- Array Sum — Easy
- Contains Duplicate — Easy
- First Free Spot — Easy
- Minimum and Maximum — Easy
- Minimum of an Array — Easy
- Shopping Cart Total — Easy