Number of Senior Citizens Problem
Number of Senior Citizens Problem — ExecCode Easy DSA Practice
Solve the Number of Senior Citizens problem on ExecCode. Free online easy DSA practice in Arrays - Logic Building. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Description You are given a 0-indexed array of strings details. Your task is to - The last two characters determine the seat allotted to that person. Each element of details provides information about a given passenger compressed into a string of length 15. The system is such that: - The first ten characters consist of the phone number of passengers. - The next character denotes the gender of the person. Return the required answer exactly as shown in the examples.
Examples
Input {"details": ["7868190130M7522", "5303914400F9211", "9273338290F4010"]}; Output 2. Input {"details": ["1313579440F2036", "2921522980M5644"]}; Output 0
Constraints
1 <= details.length <= 100 details[i].length == 15 details[i] consists of digits from '0' to '9'. details[i][10] is either 'M' or 'F' or 'O'. The phone numbers and seat numbers of the passengers are distinct.
Practice Number of Senior Citizens free on ExecCode. Browse DSA problems, topic map, and placement guides.