C
\nint maximumDetonation(int** bombs, int bombsSize, int* bombsColSize){\n    bool* check = calloc(bombsSize, sizeof(bool));\n    bool** attach = malloc(bombsSiz
```\nint maximumDetonation(int** bombs, int bombsSize, int* bombsColSize){\n    bool* check = calloc(bombsSize, sizeof(bool));\n    bool** attach = malloc(bombsSize * sizeof(bool*));\n    for(int i = 0; i < bombsSize; i++){\n        attach[i] = calloc(bombsSize , sizeof(bool));\n    }\n\n    for(int i = 0; i < bombsSize; i++){\n        attach[i][i] = true;\n        for(int j = i+1; j < bombsSize; j++){\n            int x = abs(bombs[i][0] - bombs[j][0] ) ;\n            int y = abs(bombs[i][1] - bombs[j][1] ) ;\n            long long dis = (long long)x*x + (long long)y*y;\n            if(dis <= (long long)bombs[i][2]*bombs[i][2])\n                attach[i][j] = true;\n            if(dis <= (long long)bombs[j][2]*bombs[j][2])\n                attach[j][i] = true;\n        }\n    }\n    \n    int* stack1 = malloc(bombsSize * sizeof(int));\n    int* stack2 = malloc(bombsSize * sizeof(int));\n    int id1 = 0, id2 = 0;\n    int max = 1;\n    for(int i = 0; i < bombsSize; i++){\n        check = calloc(bombsSize, sizeof(bool));\n        int cur = 1;\n        check[i] = true;\n        stack1[id1] = i;\n        id1++;\n        while(id1 || id2){\n            if(id1){\n                for(int j = 0; j < id1; j++){\n                    int p = stack1[j];\n                    for(int k = 0; k < bombsSize; k++){\n                        if(attach[p][k] && check[k] == false){\n                            cur++;\n                            check[k] = true;\n                            stack2[id2] = k;\n                            id2++;\n                        }\n                    }\n                }\n                id1 = 0;\n            }\n            else{\n                for(int j = 0; j < id2; j++){\n                    int p = stack2[j];\n                    for(int k = 0; k < bombsSize; k++){\n                        if(attach[p][k] && check[k] == false){\n                            cur++;\n                            check[k] = true;\n                            stack1[id1] = k;\n                            id1++;\n                        }\n                    }\n                }\n                id2 = 0;\n            }\n        }\n        max = fmax(max, cur);\n    }\n    return max;\n}\n```
['Breadth-First Search']