Swift | Minimal BFS
BFS (accepted answer)\n\nclass Solution {\n    func maximumDetonation(_ bombs: [[Int]]) -> Int {\n\t\n        func contains(_ a:[Int], _ b:[Int]) -> Bool {\n   
**BFS (accepted answer)**\n```\nclass Solution {\n    func maximumDetonation(_ bombs: [[Int]]) -> Int {\n\t\n        func contains(_ a:[Int], _ b:[Int]) -> Bool {\n            let (deltaX, deltaY) = (a[0]-b[0], a[1]-b[1])\n            return deltaX * deltaX + deltaY * deltaY <= a[2] * a[2]\n        }\n        \n        let bombsInRadius = bombs.indices.map { i in\n            bombs.indices.filter { j in contains(bombs[i], bombs[j]) }\n        }\n        \n        func bfs(_ start: Int) -> Int {\n            var bfs = Set([start]), visited = bfs\n            while !bfs.isEmpty {\n                bfs = Set(bfs.flatMap { bomb in bombsInRadius[bomb]}).subtracting(visited)\n                visited.formUnion(bfs)\n            }\n            return visited.count\n        }\n        \n        return bombs.indices.map(bfs).max()!\n    }\n}\n```
['Swift']