✅✅[C++/Java/Python/JS] BEATS 💯⚡⌛| EASY SOLUTION 🗝️ with EXPLANATION🍨
IntuitionThe problem asks to count the number of seniors in a list of details. A senior is defined as someone whose age is greater than 60. Each string in the i
# Intuition
The problem asks to count the number of seniors in a list of details. A senior is defined as someone whose age is greater than 60. Each string in the input contains the person's details, and the age is embedded in the string at a specific position (from index 11 to 12). The goal is to extract the age, check if it’s greater than 60, and count how many such seniors are present.

# Approach
1. Loop through each person's details in the list.
2. Extract the age from the 11th and 12th characters of the string. These two characters represent the tens and ones place of the age.
3. Convert these characters into an integer to get the age.
4. If the age is greater than 60, increment the senior count.
5. Continue this for all the strings in the list.
6. Return the total count of seniors.

# Complexity
- **Time Complexity**: `O(n)`, where `n` is the number of people in the list. We loop through each string once, performing constant-time operations for each string.
- **Space Complexity**: `O(1)`, as we only need a few extra variables to store intermediate results (the senior count and age).

# Code

```cpp []
class Solution {
public:
    int countSeniors(vector<string>& details) {
        int count = 0;
        for (int i = 0; i < details.size(); i++) {
            int age = (details[i][11] - '0') * 10 + (details[i][12] - '0');
            if (age > 60) count++;
        }
        return count;
    }
};

```

```python []
class Solution:
    def countSeniors(self, details: List[str]) -> int:
        count = 0
        for detail in details:
            age = int(detail[11:13])
            if age > 60:
                count += 1
        return count

```

```java []
class Solution {
    public int countSeniors(String[] det) {
        int ct=0;
        for(String s:det){
            int age=10*(s.charAt(11)-'0')+s.charAt(12)-'0';
            if(age>60)
            ct++;
        }
        return ct;
    }
}

```

```javascript []
/**
 * @param {string[]} details
 * @return {number}
 */
var countSeniors = function(details) {
    let count = 0;
    for (let detail of details) {
        let age = parseInt(detail.substring(11, 13));
        if (age > 60) {
            count++;
        }
    }
    return count;
};

```

```
✨ AN UPVOTE WILL BE APPRECIATED ^_~ ✨
```
['Python', 'C++', 'Java', 'Python3', 'JavaScript']