Simple solution using Java : DFS
The algorithm is pretty simple \n- First of all you need to create a graph such that it stores the bombs which are located in its range. We have the radius of t
# The algorithm is pretty simple \n- First of all you need to create a graph such that it stores the bombs which are located in its range. We have the radius of the bomb and we run a for loop iterating over all the bombs calculate the distance between the two bombs and compare with the radius then we will able to decide whether the bomb is in our range or not.\n- After creating the graph we need to run DFS/BFS algorithm on the graph and find the total no.of reachable nodes from a particular node. We need to run this for all the nodes present in the graph.\n- The DFS/BFS algorithm count all the reachable nodes and returns the value. We store our result in a varaible called \'result\' and compare it with the newly arrived DFS count.\n- It is a very simple problem , if you are able to write functions for different parts of the problem like Creation of graph and DFS/BFS function.\n\n---\n\n\n\n# Code\n```\nclass Solution {\n    public int DFS(HashMap<Integer,ArrayList<Integer>> adj , int source,boolean[] visited)\n    {\n        visited[source] = true;\n        int res = 1;\n        for(int item : adj.get(source))\n        {\n            if(visited[item] == false)\n            {\n                res += DFS(adj,item,visited);\n            }\n        }\n        return res;\n    }\n    public int maximumDetonation(int[][] bombs) {\n        HashMap<Integer,ArrayList<Integer>> hmap = new HashMap<>();\n        for(int i = 0;i<bombs.length;i++)\n        {\n            ArrayList<Integer> arr = new ArrayList<>();\n            hmap.put(i,arr);\n        }\n        for(int i = 0;i<bombs.length;i++)\n        {\n            long x1 = bombs[i][0];\n            long y1 = bombs[i][1];\n            long r1 = bombs[i][2];\n            for(int j = 0;j<bombs.length;j++)\n            {\n                if(i!=j)\n                {\n                    long x2 = bombs[j][0];\n                    long y2 = bombs[j][1];\n                    if(((x2-x1)*(x2-x1)) + ((y2-y1)*(y2-y1)) <= r1*r1)\n                    {\n                        ArrayList<Integer> arr = hmap.get(i);\n                        arr.add(j);\n                        hmap.put(i,arr);\n                    } \n                }  \n            }\n        }\n        int result = 1;\n        for(int i = 0;i<bombs.length;i++)\n        {\n            boolean[] visited = new boolean[bombs.length];\n            result = Math.max(result,DFS(hmap,i,visited));\n        }\n        return result;\n    }\n}\n```\n\n---\n\n\n#### *If you\'ve liked my explanation don\'t forget to upvote and encourage.*
['Depth-First Search', 'Breadth-First Search', 'Graph', 'C++', 'Java']