Ctrl K

Passengers Over Sixty

Easy
Each passenger's data is packed into a single 15-character string tickets[i]: - the first 10 characters are the phone number; - the 11th character is the gender: M, F or O; - the next two characters are the age; - the last two are the seat number. Return how many passengers are strictly older than 60.
Example 1
tickets=["5550001122F6114", "5550003344M6007", "5550005566O8801"] → 2

The ages are 61, 60 and 88. Two passengers are over 60: 61 and 88; exactly 60 does not count.

Example 2
tickets=["9001234567M2503"] → 0

The passenger is 25.

Constraints
  • 1 ≤ len(tickets) ≤ 100
  • len(tickets[i]) = 15
  • every character except the 11th is a digit 0–9
  • tickets[i][10] is one of M, F, O
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsTwo Words, Closest Apart EasyOne-Row Typing EasyDinner for Two EasyPhrases with Synonyms EasyWord from a License Plate Easy
loading Python…
Input
tickets=["5550001122F6114", "5550003344M6007", "5550005566O8801"]
Expected
2

Run checks the first 3 tests in your browser. Submit checks all 80 tests on the server, hidden ones included.