1-line with lambda||0ms beats 100%
Intuition\n Describe your first thoughts on how to solve this problem. \nJust a pratice for strings.\n# Approach\n Describe your approach to solving the problem
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nJust a pratice for strings.\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1. Use `count_if`\n2. Define the lambda    `[](string& s){\n            return stoi(s.substr(11,2))>60;\n        };`\n3. 2nd C++ uses accumulate, Python uses sum\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(n)$$\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n$$O(1)$$\n# 1-line Code||C++ 0ms beats 100%\n```\nclass Solution {\npublic:\n    static int countSeniors(vector<string>& details) {\n        return count_if(details.begin(), details.end(), [](string& s){\n            return stoi(s.substr(11,2))>60;\n        });\n    }\n};\n\n\n\n\n\nauto init = []() {\n    ios::sync_with_stdio(false);\n    cin.tie(nullptr);\n    cout.tie(nullptr);\n    return \'c\';\n}();\n```\n# C++ using loop\n```\nclass Solution {\npublic:\n    static int countSeniors(vector<string>& details) {\n        int cnt=0;\n        for(string& s: details)\n            cnt+=stoi(s.substr(11,2))>60;\n        return cnt;\n    }\n};\n\n```\n# C++ using accumulate where the string comparison is used in the lambda\n```\nint countSeniors(vector<string>& details) {\n    return accumulate(details.begin(), details.end(), 0, [](int sum, string& s){\n            return sum+=s.substr(11,2)>"60"?1:0;\n    });\n}\n```\n# Python 1-liner\n```\nclass Solution:\n    def countSeniors(self, details: List[str]) -> int:\n        return sum(1 if int(s[11:13])>60 else 0 for s in details)\n        \n```
['String', 'C++', 'Python3']