Video solution | Intuition explained in detail | C++ | BFS | Hindi
Video\nHey everyone i have created a video solution for this problem (its in hindi), it involves intuitive explanation with code, this video is part of my playl
# Video\nHey everyone i have created a video solution for this problem (its in hindi), it involves intuitive explanation with code, this video is part of my playlist "Master Graphs"\nVideo link : https://youtu.be/hkD8JUuWbkA\nPlaylist link: : https://www.youtube.com/playlist?list=PLICVjZ3X1AcZ5c2oXYABLHlswC_1LhelY\n\n\n\n# Code\n```cpp []\n\n#define ll long long\nclass Solution {\npublic:\n\n    int bfs(int i, unordered_map<int,vector<int>> &graph, int n){\n        int count=0;\n        vector<int> visited(n,false);\n        queue<int> q;\n        q.push(i);\n        visited[i]=true;\n        while(!q.empty()){\n            int curr=q.front();\n            q.pop();\n            count++;\n            for(auto &bomb: graph[curr]){\n                if(!visited[bomb]){\n                    q.push(bomb);\n                    visited[bomb]=true;\n                }\n            }\n        }\n        return count;\n\n    }\n\n    bool checkIfInside(ll curr_x, ll curr_y,ll curr_rad,ll x,ll y){\n        if((curr_x-x)*(curr_x-x) + (curr_y-y)*(curr_y-y) <= curr_rad*curr_rad) return true;\n        return false;\n    }\n    int maximumDetonation(vector<vector<int>>& bombs) {\n        int n= bombs.size();\n        unordered_map<int,vector<int>> graph;\n\n        for(int i=0;i<n;i++){\n            int curr_x= bombs[i][0];\n            int curr_y= bombs[i][1];\n            int curr_rad= bombs[i][2];\n            for(int j=0;j<n;j++){\n                if(i!=j){\n                    int x= bombs[j][0];\n                    int y= bombs[j][1];\n                    if(checkIfInside(curr_x,curr_y,curr_rad,x,y)){\n                        graph[i].push_back(j);\n                    }\n                }\n            }\n\n        }\n        int ans=0;\n        for(int i=0;i<n;i++){\n            ans=max(ans, bfs(i, graph,n));\n        }\n\n        return ans;\n\n\n\n    }\n};\n```
['C++']