💯✅🔥Detailed Easy Java ,Python3 ,C++ Solution|| 0 ms ||≧◠‿◠≦✌
Intuition\nThe intuition behind the solution is straightforward: we need to extract the age information from each string and determine if it indicates a senior 
# Intuition\nThe intuition behind the solution is straightforward: we need to extract the age information from each string and determine if it indicates a senior (age greater than 60). The age is represented by the last two characters in the string, which are extracted and converted into an integer for comparison.\n\n---\n\n# Approach\n1. **Iterate through the list of strings**: For each string, we will check the last two characters.\n2. **Extract the age**: Convert the last two characters into an integer.\n3. **Count seniors**: If the age is greater than 60, increment the count.\n4. **Return the count**: Finally, return the total count of seniors.\n\n---\n# Step-by-Step Explanation\nLet\'s analyze the input `["7868190130M7522","5303914400F9211","9273338290F4010"]`:\n\n1. **First String: "7868190130M7522"**\n   - Extract the last two characters: `ss.charAt(11)` is `\'7\'` and `ss.charAt(12)` is `\'2\'`.\n   - Calculate the age: `age = 7 * 10 + 2 = 72`.\n   - Since 72 > 60, increment the count (`ans` becomes 1).\n\n2. **Second String: "5303914400F9211"**\n   - Extract the last two characters: `ss.charAt(11)` is `\'9\'` and `ss.charAt(12)` is `\'1\'`.\n   - Calculate the age: `age = 9 * 10 + 1 = 91`.\n   - Since 91 > 60, increment the count (`ans` becomes 2).\n\n3. **Third String: "9273338290F4010"**\n   - Extract the last two characters: `ss.charAt(11)` is `\'4\'` and `ss.charAt(12)` is `\'0\'`.\n   - Calculate the age: `age = 4 * 10 + 0 = 40`.\n   - Since 40 is not greater than 60, do not increment the count (`ans` remains 2).\n\nFinally, the method returns `ans`, which is `2`, indicating there are 2 seniors in the provided list.\n\n---\n# Time Complexity\n- The time complexity of the solution is **O(n)**, where **n** is the number of strings in the input array. This is because we are iterating through each string exactly once.\n\n---\n\n# Space Complexity\n- The space complexity is **O(1)**, as we are using a constant amount of extra space (the variable `ans`).\n\n---\n\n```java []\nclass Solution {\n    public int countSeniors(String[] s) {\n        int ans=0;\n        for(String ss:s){\n            int a1=ss.charAt(11)-\'0\';\n            int a2=ss.charAt(12)-\'0\'; \n            if((a1*10)+a2>60)\n                ans++;\n        }\n        return ans;\n    }\n}\n```\n```python3 []\nclass Solution:\n    def countSeniors(self, s):\n        ans = 0\n        for ss in s:\n            a1 = int(ss[11])  # Get the 12th character as an integer\n            a2 = int(ss[12])  # Get the 13th character as an integer\n            if (a1 * 10) + a2 > 60:\n                ans += 1\n        return ans\n```\n```C++ []\nclass Solution {\npublic:\n    int countSeniors(vector<string>& s) {\n        int ans = 0;\n        for (const auto& ss : s) {\n            int a1 = ss[11] - \'0\';\n            int a2 = ss[12] - \'0\';\n            if ((a1 * 10) + a2 > 60) {\n                ans++;\n            }\n        }\n        return ans;\n    }\n};\n```\n\n---\n\n![upvote.png](https://assets.leetcode.com/users/images/e6f4f26f-a7f5-465b-8ec1-aa665db072f9_1719537871.6475258.png)\n---
['Array', 'String', 'C++', 'Java', 'Python3']