<p>You are given a <strong>0-indexed</strong> array of strings <code>details</code>. Each element of <code>details</code> provides information about a given passenger compressed into a string of length <code>15</code>. The system is such that:</p>

<ul>
	<li>The first ten characters consist of the phone number of passengers.</li>
	<li>The next character denotes the gender of the person.</li>
	<li>The following two characters are used to indicate the age of the person.</li>
	<li>The last two characters determine the seat allotted to that person.</li>
</ul>

<p>Return <em>the number of passengers who are <strong>strictly </strong><strong>more than 60 years old</strong>.</em></p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> details = [&quot;7868190130M7522&quot;,&quot;5303914400F9211&quot;,&quot;9273338290F4010&quot;]
<strong>Output:</strong> 2
<strong>Explanation:</strong> The passengers at indices 0, 1, and 2 have ages 75, 92, and 40. Thus, there are 2 people who are over 60 years old.
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> details = [&quot;1313579440F2036&quot;,&quot;2921522980M5644&quot;]
<strong>Output:</strong> 0
<strong>Explanation:</strong> None of the passengers are older than 60.
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>1 &lt;= details.length &lt;= 100</code></li>
	<li><code>details[i].length == 15</code></li>
	<li><code>details[i] consists of digits from &#39;0&#39; to &#39;9&#39;.</code></li>
	<li><code>details[i][10] is either &#39;M&#39; or &#39;F&#39; or &#39;O&#39;.</code></li>
	<li>The phone numbers and seat numbers of the passengers are distinct.</li>
</ul>

# Data Structure: Array of strings where each string represents passenger details
# Algorithm: Extract the age from each string and count how many passengers are strictly older than 60

# Short Intuition:
# Each string contains compressed information, and the age is stored in the 12th and 13th characters. We can extract these two characters, convert them to an integer, and count how many are greater than 60.

# Detailed Intuition:
# - The input array contains passenger details, where each string is of fixed length (15 characters).
# - The age is represented by the 12th and 13th characters in the string.
# - For each string in the array, we extract the age, check if it is greater than 60, and count the number of such passengers.

# Pseudo Code:
# 1. Initialize a counter for passengers older than 60.
# 2. Iterate through the list of details.
# 3. For each string, extract the age by taking the 12th and 13th characters and converting them to an integer.
# 4. If the age is greater than 60, increment the counter.
# 5. Return the counter.

from typing import List

class Solution:
    def countSeniors(self, details: List[str]) -> int:
        count = 0  # Initialize a counter for seniors
        
        # Step 1: Iterate through the list of passenger details
        for detail in details:
            # Step 2: Extract the age from the 12th and 13th characters
            age = int(detail[11:13])
            
            # Step 3: Check if the age is greater than 60
            if age > 60:
                count += 1  # Increment the counter
        
        # Step 4: Return the total count of senior passengers
        return count

# Time Complexity: O(n), where n is the number of passengers (length of the details array).
# Explanation: We traverse each string and extract the age in constant time.

# Space Complexity: O(1)
# Explanation: We only use a few variables to track the count and age.

16300