Swift💯1liner
Good Interview Answer (accepted answer)\nClean, idiomatic, no conversion to [Character]. Thanks to @pagafan7as for the comparison code reduction tip.\n\nclass S
**Good Interview Answer (accepted answer)**\nClean, idiomatic, no conversion to `[Character]`. Thanks to @pagafan7as for the comparison code reduction tip.\n```\nclass Solution {\n    func countSeniors(_ details: [String]) -> Int {\n        var count = 0\n        for detail in details {\n            let age = detail.dropFirst(11).dropLast(2)\n            count += (age.first!, age.last!) > ("6","0") ? 1:0\n        }\n        return count\n    }\n}\n```\n```\nclass Solution { // Rewrite with Functional Programming\n    func countSeniors(_ details: [String]) -> Int {\n        details\n        .map {detail in detail.dropFirst(11).dropLast(2) }\n        .filter{age in (age.first!, age.last!) > ("6","0")}\n        .count\n    }\n}\n```\n\n**\uD83D\uDD25 One-Liner using Regex (accepted answer)**\n```\nclass Solution {\n    func countSeniors(_ details: [String]) -> Int {\n        details.compactMap{$0.prefixMatch(of: #/.{11}(6[1-9]|[7-9]\\d)/#)}.count\n    }\n}\n```
['Swift']