A neighborhood co-op library issues heritage membership cards to its longtime patrons. Every card is printed with a fixed 15-character code made only of uppercase English letters and digits: the first 10 characters form the card's serial number, the 11th character is a single uppercase letter identifying the issuing branch, the 12th and 13th characters are two digits giving the cardholder's age, and the final two characters are an alphanumeric checkout-counter code. The library wants to know how many issued cards belong to members who are strictly older than 60, since those members automatically qualify for the heritage discount.
Given the list of card codes, count how many of them belong to cardholders strictly older than 60.
Print a single integer: the number of cards whose two-digit age value is strictly greater than 60.
Example 1
Input
3 AB12345678X75Z9 CD98765432Y60W1 EF11223344Z45Q2
Expected
1
Explanation
The first card encodes age 75 (its 12th-13th characters are "75"), which is strictly greater than 60, so it counts. The second card encodes age 60, which is not strictly greater than 60, so it does not count. The third card encodes age 45, which also does not count. Only 1 card qualifies.
Example 2
Input
4 GH55667788K61R3 IJ00998877L99S4 KL11335577M60T5 MN22446688N00U6
Expected
2
Explanation
The ages encoded by the four cards are 61, 99, 60, and 00 respectively. Only 61 and 99 are strictly greater than 60, so 2 cards qualify.
Ready to solve this?
Sign in to open the editor, run your code against the sample tests, and submit against the full test suite.
Sign in to solve →