[Swift] hash-map, zip, reduce; o(n) run-time (simple to understand); and a one-liner
map.reduce has o(n) run-time complexity.\n\n\n    func isAnagram(_ s: String, _ t: String) -> Bool {\n        guard s.count == t.count else { return false }\n  
map.reduce has o(n) run-time complexity.\n\n```\n    func isAnagram(_ s: String, _ t: String) -> Bool {\n        guard s.count == t.count else { return false }\n        var map = [Character : Int]()\n        for (c1, c2) in zip(s,t) {\n            map[c1, default: 0] += 1\n            map[c2, default: 0] -= 1\n        }\n        return map.reduce(0, { $0 + abs($1.value) }) == 0\n    }\n```\nAnd a one-liner:\n```\nfunc isAnagram(_ s: String, _ t: String) -> Bool {\n    return Dictionary(s.map{($0,1)}){$0+$1} == Dictionary(t.map{($0,1)}){$0+$1}\n}
['Swift']