Tap here to switch tabs
Problem
Submissions

Problem: Number of Senior Citizens

med
30 min
Try to solve the Number of Senior Citizens problem.

Statement

You are given an array of strings details, where each element represents information about a passenger. Each string details[i] has a length of 1515 characters and is formatted as follows:

  • The first 1010 characters represent the passenger’s phone number.

  • The 11extth11^{ ext{th}} character denotes the passenger’s gender.

  • The next 22 characters represent the passenger’s age.

  • The final 22 characters indicate the assigned seat number.

Return the total number of passengers whose age is strictly greater than 6060.

Constraints:

  • 1≤1 \leq details.length ≤100\leq 100

  • details[i].length =15= 15

  • details[i] consists of digits from '0' to '9'.

  • details[i][10] is either 'M', 'F', or 'O'.

  • The phone numbers and seat numbers of the passengers are distinct.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Number of Senior Citizens

med
30 min
Try to solve the Number of Senior Citizens problem.

Statement

You are given an array of strings details, where each element represents information about a passenger. Each string details[i] has a length of 1515 characters and is formatted as follows:

  • The first 1010 characters represent the passenger’s phone number.

  • The 11extth11^{ ext{th}} character denotes the passenger’s gender.

  • The next 22 characters represent the passenger’s age.

  • The final 22 characters indicate the assigned seat number.

Return the total number of passengers whose age is strictly greater than 6060.

Constraints:

  • 1≤1 \leq details.length ≤100\leq 100

  • details[i].length =15= 15

  • details[i] consists of digits from '0' to '9'.

  • details[i][10] is either 'M', 'F', or 'O'.

  • The phone numbers and seat numbers of the passengers are distinct.