✅ FP Style
Solution\n##### #1\n\n`FP` + `.utf8CString` = more performant\n\nswift\nstruct Solution {\n    @_optimize(speed)\n    func scoreOfString(_ s: String) -> Int {\n
# Solution\n##### #1\n```\n`FP` + `.utf8CString` = more performant\n```\n```swift\nstruct Solution {\n    @_optimize(speed)\n    func scoreOfString(_ s: String) -> Int {\n        let codes = s.utf8CString.dropLast()\n        return codes.indices[1...].reduce(0) { score, i in\n            score + abs(Int(codes[i] - codes[i - 1]))\n        }\n    }\n}\n```\n\n##### #2\n```\n`FP` + `.compactMap` = straightforward but less performant\n```\n```swift\nstruct Solution {\n    @_optimize(speed)\n    func scoreOfString(_ s: String) -> Int {\n        let codes = s.compactMap(\\.asciiValue)\n                     .map(Int.init)\n        return codes.indices[1...].reduce(0) { score, i in\n            score + abs(codes[i] - codes[i - 1]) \n        }\n    }\n}\n```
['String', 'Swift']