explaination for why union find not working
Detonation condition is NOT intersection\n2. 1. BUT intersection should include co-ordinate of other bomb range\n2. UNION FIND WILL GIVE FALSE ANSWER FOR BELOW 
**Detonation condition is NOT intersection\n2. 1. BUT intersection should include co-ordinate of other bomb range\n2. UNION FIND WILL GIVE FALSE ANSWER FOR BELOW CASE**\ngiven A(0,0,5) B (4,0,1)  C)(9,0,5)\n\n![image](https://assets.leetcode.com/users/images/d918d62e-b7ff-43e7-be94-2ee3a2f84c7c_1711417630.7414768.png)\n\n\nHence Do BFS or (DFS)\nBFS code java\n```\npublic int maximumDetonation(int[][] bombs) {        \n        int n=bombs.length;                \n        int max=0;        \n        for(int i=0;i<n;i++){            \n            \n            int count=0;\n            boolean[] visit=new boolean[n];\n            Queue<Integer> q = new LinkedList<>();\n            q.offer(i);        \n            \n            while(!q.isEmpty()){\n                int u=q.poll();\n                visit[u]=true;\n                count++;\n            \n                for(int v=0;v<n;v++){\n                    if(u==v||visit[v])\n                        continue;\n\n                    if(test(u,v,bombs)){\n                        visit[v]=true;\n                        q.offer(v);\n                    }   \n                }\n            }                                    \n             \n            max=Math.max(max,count);\n        }\n        \n        return max;    \n        \n    }\n    \n    private boolean test(int i,int j,int[][] bombs){\n        int[] b1=bombs[i],b2=bombs[j];\n        long x1=b1[0],y1=b1[1],r1=b1[2];\n        long x2=b2[0],y2=b2[1],r2=b2[2];\n        \n        return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)<=r1*r1;\n        \n    }\n\n\n```\n
['Breadth-First Search', 'Graph']