✔️ 100% Fastest Swift Solution
\nclass Solution {\n    func groupAnagrams(_ strs: [String]) -> [[String]] {\n        var map: [String: [String]] = [:]\n        var res: [[String]] = []\n\n   
```\nclass Solution {\n    func groupAnagrams(_ strs: [String]) -> [[String]] {\n        var map: [String: [String]] = [:]\n        var res: [[String]] = []\n\n        \n        func sort(_ str: String) -> String {\n            var chars = Array(str)\n            let sorted = chars.sorted()\n            var string = ""\n            for c in sorted { string += String(c) }\n            return string\n        }\n\n        for str in strs {\n            let sorted_str = sort(str)\n            if let _ = map[sorted_str] {\n                map[sorted_str]?.append(str)\n            } else {\n                map[sorted_str] = [str]\n            }\n        }\n        for (_, value) in map { res.append(value) }        \n        return res\n    }\n\n}\n```\n\nLet me know in comments if you have any doubts. I will be happy to answer.\n\nPlease upvote if you found the solution useful.
['Swift']