✅ [Solution][Swift] DFS
TC: O(n * n)\nSC: O(n * n)\n\nclass Solution {\n    func maximumDetonation(_ bombs: [[Int]]) -> Int {\n        func check(\n            point: (x: Int, y: Int),
**TC:** O(n * n)\n**SC:** O(n * n)\n```\nclass Solution {\n    func maximumDetonation(_ bombs: [[Int]]) -> Int {\n        func check(\n            point: (x: Int, y: Int),\n            isInside circle: (x: Int, y: Int, r: Int)\n        ) -> Bool {\n            let distance = sqrt(\n                pow(Double(point.x - circle.x), 2.0) + pow(Double(point.y - circle.y), 2.0)\n            )\n            return Double(circle.r) >= distance\n        }\n\n        let n = bombs.count\n        var map = [Int: [Int]]()\n        var result = 1\n\n        for i in 0..<n {\n            map[i] = []\n            for j in 0..<n where j != i {\n                guard check(point: (bombs[j][0], bombs[j][1]), isInside: (bombs[i][0], bombs[i][1], bombs[i][2])) \n                else { continue }\n                map[i]?.append(j)\n            }\n        }\n\n        for i in 0..<n {\n            var used = Set<Int>()\n            var current = Set<Int>([i])\n            while !current.isEmpty {\n                let node = current.removeFirst()\n                used.insert(node)\n                for adj in map[node]! where !used.contains(adj) {\n                    current.insert(adj)\n                }\n            }\n\n            result = max(result, used.count)\n        }\n\n        return result\n    }\n}\n```
['Depth-First Search', 'Swift']