C++ solution using DFS
Complexity\n- Time complexity:\nO(n^3)\n\n- Space complexity:\nO(n^2)to store the graph + O(n)for dfs recursion stack\n\n# Code\n\n class Solution {\npublic:\n 
# Complexity\n- Time complexity:\nO(n^3)\n\n- Space complexity:\nO(n^2)to store the graph + O(n)for dfs recursion stack\n\n# Code\n```\n class Solution {\npublic:\n    //general dfs algorithm to find all the connected bombs (you can use bfs as well)\n    void dfs(int node, vector<int> &visited, vector<int> adj[], int &cnt){\n        visited[node] = 1;\n        cnt++;\n\n        for(auto neighbour: adj[node]){\n            if(!visited[neighbour]){\n                dfs(neighbour, visited, adj, cnt);\n            }\n        }\n    }\n\n    int maximumDetonation(vector<vector<int>>& bombs) {\n        int n = bombs.size();\n        vector<int> adj[n];\n\n        //make a directed graph of the distance of bombs with one another\n        //if the radius of a bomb is greater than the distance with another bomb -> it means there is a directed edge between them\n        for(int i=0; i<n; i++){\n            long long int x0, y0, r0;\n            x0 = bombs[i][0];\n            y0 = bombs[i][1];\n            r0 = bombs[i][2];\n\n            for(int j=0; j<n; j++){\n                //if i and j are equal it means both bombs are same so there is no need to check\n                if(i != j){\n                    long long int x, y;\n                    x = abs(x0 - bombs[j][0]);\n                    y = abs(y0 - bombs[j][1]);\n\n                    if(x*x + y*y <= r0*r0){\n                        adj[i].push_back(j);\n                    }\n                }\n            }\n        }\n\n        //call dfs for every node to see how many bombs are connected with that single bomb\n        int ans = INT_MIN;\n        for(int i=0; i<n; i++){\n            int cnt = 0;\n            vector<int> visited(n, 0);\n            dfs(i, visited, adj, cnt);\n\n            ans = max(ans, cnt);\n        }\n\n        //return the bomb with maximum number of connected bombs\n        return ans;\n    }\n};\n```
['Array', 'Math', 'Depth-First Search', 'Graph', 'C++']