🧑‍🎓 Just 5 lines code 😲❤️‍🔥 Detailed Explanation ✅ Very Easy C++ Approach✨ Beats 💯 % 🚀🎉‼️
Intuition\nFirst of all I tried to analyse what is the index position where we have to mainly focus for getting age from each string record. Then performed coun
# Intuition\nFirst of all I tried to analyse what is the index position where we have to mainly focus for getting age from each string record. Then performed counting how many people were aged above 60.\n\n![Screenshot_4.png](https://assets.leetcode.com/users/images/6da88849-394e-4f22-9205-456ad028cba3_1722509392.5677688.png)\n\n\n# Approach\n- Create two variables `age` and `count` with count being initialised to 0.\n- Now traverse through the `details` vector.\n- Use `substr()` function to take a portion of string from the entire string.\n- Now, convert it to integer from string using `stoi()` function and store it in `age`.\n- Then increase the `count` if `age` is greater than 60.\n- Finally, return the `count`.\n# Complexity\n- **Time complexity:** O(N) \u23F3\n\n- **Space complexity:** O(1) \uD83D\uDE80\n\n# Code\n```\nclass Solution {\npublic:\n    int countSeniors(vector<string>& details) {\n        int age,count=0;\n        for(auto x: details){\n            age=stoi(x.substr(11,2));\n            count+=(age>60);\n        }\n        return count;\n    }\n};\n```\n\n\uD835\uDE4B\uD835\uDE61\uD835\uDE5A\uD835\uDE56\uD835\uDE68\uD835\uDE5A \uD835\uDE6A\uD835\uDE65\uD835\uDE6B\uD835\uDE64\uD835\uDE69\uD835\uDE5A\uD83D\uDC4D \uD835\uDE5E\uD835\uDE5B \uD835\uDE6E\uD835\uDE64\uD835\uDE6A \uD835\uDE5B\uD835\uDE64\uD835\uDE6A\uD835\uDE63\uD835\uDE59 \uD835\uDE5E\uD835\uDE69 \uD835\uDE5D\uD835\uDE5A\uD835\uDE61\uD835\uDE65\uD835\uDE5B\uD835\uDE6A\uD835\uDE61 \uD835\uDE5C\uD835\uDE6A\uD835\uDE6E\uD835\uDE68 \uD835\uDE56\uD835\uDE68 \uD835\uDE5E\uD835\uDE69 \uD835\uDE6C\uD835\uDE64\uD835\uDE6A\uD835\uDE61\uD835\uDE59 \uD835\uDE5A\uD835\uDE63\uD835\uDE58\uD835\uDE64\uD835\uDE6A\uD835\uDE67\uD835\uDE56\uD835\uDE5C\uD835\uDE5A \uD835\uDE62\uD835\uDE5A \uD835\uDE69\uD835\uDE64 \uD835\uDE65\uD835\uDE64\uD835\uDE68\uD835\uDE69 \uD835\uDE62\uD835\uDE64\uD835\uDE67\uD835\uDE5A \uD835\uDE68\uD835\uDE6A\uD835\uDE58\uD835\uDE5D \uD835\uDE68\uD835\uDE64\uD835\uDE61\uD835\uDE6A\uD835\uDE69\uD835\uDE5E\uD835\uDE64\uD835\uDE63\uD835\uDE68. \uD83D\uDE07
['Array', 'String', 'C++']