Practice Number of Senior Citizens
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Each 15-character entry in details stores ten phone-number characters, then one gender character, then two decimal age digits, then two seat characters. Count passengers whose age is strictly greater than 60.
Source: Number of Senior Citizens on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
details = ["7868190130M7522","5303914400F9211","9273338290F4010"]
Output
2
# Example 2
Input
details = ["1313579440F2036","2921522980M5644"]
Output
0
Constraints
1 <= details.length <= 100
details[i].length == 15
details[i] consists of digits from '0' to '9'.
details[i][10] is either 'M' or 'F' or 'O'.
The phone numbers and seat numbers of the passengers are distinct.
Related LeetCode Problems
Practice more problems similar to Number of Senior Citizens.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.