Count Patients by Age Group

Medium

📝 Description

Count how many patients fall into age groups: Child (<18), Adult (18-65), Senior (>65).

Input Format

[ {"name": "Alice", "age": 25}, {"name": "Bob", "age": 70} ]

Output Format

{ "Child": 0, "Adult": 1, "Senior": 1 }

Constraints

Number of patients ≤ 10^5

🔍 Sample Input

[ {"name": "Alice", "age": 25}, {"name": "Bob", "age": 70} ]
            

✅ Sample Output

{ "Child": 0, "Adult": 1, "Senior": 1 }
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run