✅Easy understandable solution || 🔥Beats 100.00%🔥|| Runtime 0ms ||Beginner Friendly📈
Intuition\n\nOBSERVATION\n\n- The age is present in the indexs 11 and 12 of the string\n\nCOMPARISION\n- All we have to do is get the age and compare if it is g
# Intuition\n\n**OBSERVATION**\n\n- The age is present in the indexs 11 and 12 of the string\n\n**COMPARISION**\n- All we have to do is get the age and compare if it is greater than sixty\n- If yes,we increment the count variable which represents the no.of passengers with age>60.\n# Approach\n**INITIALIZATION**\n- We need a count variable initialized to 0\n\n**ITERATION**\n- We iterate through the given String array\n- In each String of the array,we get the character present at index 11 and index 12\n- To convert these characters into integers we subtract it with\'0\'\n- Now we have the digits.\n- We know that the digit present at the 11th index should be in the tens place.Hence we multiply it with 10 and add it to the digit present at index 12 which is supposed to be at ones place.\n- The above can be stored in a variable age\n\n**COMPARISION**\n- Now that we have the age,we have to see if it is greater than 60.\n- If yes,we increment count\n- Else we just continue\n\n**RETURN STATEMENT**\n- We return the age after doing all the above steps\n# Complexity\n- Time complexity:\nO(N)\n- Space complexity:\nO(1)\n\n# Code:\n```Java []\nclass Solution {\n    public int countSeniors(String[] details) {\n        int count=0;\n        for(String a:details)\n        {\n            int ten=a.charAt(11)-\'0\';\n            int one=a.charAt(12)-\'0\';\n            int age=ten*10+one;\n            if(age>60)\n            {\n                count++;\n            }\n        }\n        return count;\n    }\n}\n```\n```C++ []\nclass Solution {\npublic:\n    int countSeniors(vector<string>& details) {\n        int count = 0;\n        for (const std::string& a : details) {\n            int ten = a[11] - \'0\';\n            int one = a[12] - \'0\';\n            int age = ten * 10 + one;\n            if (age > 60) {\n                count++;\n            }\n        }\n        return count;\n    }\n};\n\n```\n\n\n```
['C++', 'Java']