C++ SIMPLE SOLUTION
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    vector<int> maxTargetNodes(vector<vector<int>>& edges1, vector<vector<int>>& edges2, int k) {\n        unordered_map<int, vector<int>> mp1, mp2;\n        vector<int> ans;\n\n        // Build adjacency lists\n        for (auto& edge : edges1) {\n            mp1[edge[0]].push_back(edge[1]);\n            mp1[edge[1]].push_back(edge[0]);\n        }\n        for (auto& edge : edges2) {\n            mp2[edge[0]].push_back(edge[1]);\n            mp2[edge[1]].push_back(edge[0]);\n        }\n\n        // Handle edge case when k == 0\n        if (k == 0) {\n            for (auto& [node, _] : mp1) {\n                ans.push_back(1); // Each node can reach only itself\n            }\n            return ans;\n        }\n\n        vector<int> v1(mp1.size());\n        vector<int> v2(mp2.size());\n        int u = INT_MIN;\n\n        // BFS for graph 1 (mp1)\n        for (auto& [start, _] : mp1) {\n            int h = k, c = 1;\n            unordered_set<int> visited;\n            queue<int> q;\n\n            visited.insert(start);\n            q.push(start);\n\n            while (!q.empty() && h > 0) {\n                int size = q.size();\n                while (size--) {\n                    int current = q.front();\n                    q.pop();\n\n                    for (int neighbor : mp1[current]) {\n                        if (visited.find(neighbor) == visited.end()) {\n                            visited.insert(neighbor);\n                            q.push(neighbor);\n                            c++;\n                        }\n                    }\n                }\n                h--;\n            }\n            v1[start] = c;\n        }\n\n        // BFS for graph 2 (mp2)\n        for (auto& [start, _] : mp2) {\n            int h = k - 1, c = 1;\n            unordered_set<int> visited;\n            queue<int> q;\n\n            visited.insert(start);\n            q.push(start);\n\n            while (!q.empty() && h > 0) {\n                int size = q.size();\n                while (size--) {\n                    int current = q.front();\n                    q.pop();\n\n                    for (int neighbor : mp2[current]) {\n                        if (visited.find(neighbor) == visited.end()) {\n                            visited.insert(neighbor);\n                            q.push(neighbor);\n                            c++;\n                        }\n                    }\n                }\n                h--;\n            }\n            u = max(u, c);\n        }\n\n        // Combine results\n        for (auto& count : v1) {\n            ans.push_back(count + u);\n        }\n\n        return ans;\n    }\n};\n\n```
['C++']