Extracting Age Out of The Passenger Details | Java | C++ | [Video Solution]
Intuition, approach, and complexity discussed in video solution in detail\nhttps://youtu.be/wVHy3btWFAo\n# Code\nJava\n\nclass Solution {\n    public int countS
# Intuition, approach, and complexity discussed in video solution in detail\nhttps://youtu.be/wVHy3btWFAo\n# Code\nJava\n```\nclass Solution {\n    public int countSeniors(String[] details) {\n        int seniorsCnt = 0;\n        for(var detail : details){\n            int age = (detail.charAt(11) - \'0\') * 10 + (detail.charAt(12) - \'0\');\n            if(age > 60)seniorsCnt++;\n        }\n        return seniorsCnt;\n    }\n}\n```\nC++\n```\nclass Solution {\npublic:\n    int countSeniors(vector<string>& details) {\n        int seniorsCnt = 0;\n        for(auto & detail : details){\n            int age = (detail[11] - \'0\') * 10 + (detail[12] - \'0\');\n            if(age > 60)seniorsCnt++;\n        }\n        return seniorsCnt;\n    }\n};\n```
['Array', 'String', 'C++', 'Java']