Maybe fastest Rust solution (100% beat by runtime and memory)
Intuition\nFirst thought was to sort by influence to neighbor bombs, then link top influencers. But I\'ve quickly infered it\'s a wrong way.\n\nSecond thought w
# Intuition\nFirst thought was to sort by influence to neighbor bombs, then link top influencers. But I\'ve quickly infered it\'s a wrong way.\n\nSecond thought was describe bombs and ther "victims" as graph. Then there is need to extract separated clusters of connected nodes. Cluster with biggest number of nodes is the answer. And it was bingo! \n\n# Approach\nBuild directed graph where nodes are bombs and edges are connections to bombs affected by blast. Pythagorean theorem is in game here. To avoid floating point arithmetic we can use squared blast radius:\n\n$$r_{i}^2 <= d_{ij}^2 = (x_{i} - x_{j})^2 + (y_{i} - y_{j})^2$$\n\n# Complexity\n- Time complexity:\n$$O(n^3)$$\n\n- Space complexity:\n$$O(n^2)$$\n\n# Code\n```\nimpl Solution {\n    // beats 100% by runtime and memory, so code is a bit wired\n    pub fn maximum_detonation(bombs: Vec<Vec<i32>>) -> i32 {\n        // Deep first graph traversing helper.\n        // Pass a starting node to search from. \n        fn count_nodes_in_cluster(graph: &Vec<Vec<usize>>, node: usize, stack: &mut Vec<usize>, visited: &mut Vec<bool>) -> usize {\n            stack.push(node);\n            while let Some(current) = stack.pop() {\n                if visited[current] {\n                    continue;\n                }\n                visited[current] = true;\n                stack.extend(graph[current].iter().cloned());\n            }\n\n            return visited.iter().filter(|&&flag| flag).count();\n        }\n\n        let bombs_count = bombs.len(); // to avoid multiple function calling\n        let mut visited = vec![false; bombs_count]; // reusable substitute of HashMap\n        let mut connected_bombs = vec![Vec::with_capacity(bombs_count-1); bombs_count]; // allocate memory ahead\n\n        for i in 0..bombs_count {\n            let x_i = bombs[i][0] as i64; // squared value may not fit in i32\n            let y_i = bombs[i][1] as i64;\n            let r_i = (bombs[i][2] as i64) * (bombs[i][2] as i64);\n\n            for j in i + 1..bombs_count {\n                let x_j = bombs[j][0] as i64;\n                let y_j = bombs[j][1] as i64;\n                let r_j = bombs[j][2] as i64;\n\n                let d = (x_i - x_j) * (x_i - x_j) + (y_i - y_j) * (y_i - y_j);\n                if d <= r_i {\n                    connected_bombs[i].push(j);\n                }\n                // don\'t forget to check reverse blast\n                if d <= r_j * r_j {\n                    connected_bombs[j].push(i);\n                }\n            }\n        }\n\n        let mut result = 0;\n        let mut stack = vec![]; // reusable stack for performance reason\n        for i in 0..bombs_count {\n            let excluded = count_nodes_in_cluster(&connected_bombs, i, &mut stack, &mut visited);\n            if excluded > result {\n                result = excluded;\n            }\n            visited.fill(false);\n        }\n\n        return result as i32;\n    }\n}\n```
['Graph', 'Geometry', 'Rust']