Simple For loop in C++.
Approach\n Describe your approach to solving the problem. \nRun a for loop on all details and use stoi function to convert 11th and 12th index of each detail(wh
# Approach\n<!-- Describe your approach to solving the problem. -->\nRun a for loop on all details and use `stoi` function to convert 11th and 12th index of each detail(which is the age of passenger). \nSo for each detail we check if `age > 60`. \n\n# Complexity\n- Time complexity:$$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:$$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int countSeniors(vector<string>& details) {\n        int count = 0;\n        for(string detail : details){\n            if(stoi(detail.substr(11, 2)) > 60) count++;\n        }\n        return count;\n    }\n};\n```
['C++']