Intuituve C++ technique using union find
Approach\n- Push the index values for each edge pre-sorting\n- Sort the given edges vector based on weights and create an answer vector\n- Find MST considering 
# Approach\n- Push the index values for each edge pre-sorting\n- Sort the given edges vector based on weights and create an answer vector\n- Find MST considering no value to be skipped and no edge to be mandatorily used\n- Loop for every edge and check if it is critical by finding the cost of MST if we skip the edge. If `new_mst > mst` then the edge is critical as the MST weight increases\n- If not critical then try madatorily using the edge by force, if the MST cost is the same as original MST `new_mst == mst` then pseudo-critical otherwise a useless edge. \n- Return the answer vector after pushing all critical and pseudo-critical edges.\n\n# Complexity\n- Time complexity: In general leetcode says the `Submission length exceeds limit` but the approximate complexity turns out to be $$O(E^2)$$ where E is the number of edges.\n\n- Space complexity: Approximately $$O(N)$$ auxiliary space for DSU where N is the number of nodes in the graph. \n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nstatic bool comp(vector<int>& a, vector<int>& b){\n    return a[2]<b[2];\n}\n\nclass DisjointSet{\n    vector<int> size,parent;\n    public:\n    DisjointSet(int n){\n        size.resize(n+1,1);\n        parent.resize(n+1,0);\n        for(int i=0;i<=n;i++) parent[i]=i;\n    }\n    \n    int findParent(int n){\n        if(parent[n]==n) return n;\n        return parent[n] = findParent(parent[n]);\n    }\n    \n    void unionBySize(int u, int v){\n        int pu = findParent(u);\n        int pv = findParent(v);\n        if(pu==pv) return;\n        if(size[pu]<size[pv]){\n            parent[pu] = pv;\n            size[pv]+=size[pu];\n        } \n        else{\n            parent[pv] = pu;\n            size[pu]+=size[pv];\n        }\n    }\n\n    bool isConnected(int n){\n        int flag=false;\n        for(int i=0;i<n;i++){\n            if(parent[i]==i){\n                if(flag) return false;\n                flag=true;\n            } \n        }\n        return flag;\n    }\n};\n\nclass Solution {\npublic:\n    int getMSTCost(int n, vector<vector<int>>& edges, int skip, int force) {\n        DisjointSet D(n);\n        int ans = 0;\n        if(force!=-1) {\n            int u = edges[force][0];\n            int v = edges[force][1];\n            int dist = edges[force][2];\n            D.unionBySize(u, v);\n            ans += dist;\n        }\n        for(int i=0;i<edges.size();i++) {\n            if (i == skip || i == force) continue;\n            int u = edges[i][0];\n            int v = edges[i][1];\n            int dist = edges[i][2];\n            if (D.findParent(u) != D.findParent(v)) {\n                D.unionBySize(u, v);\n                ans += dist;\n            }\n        }\n        if (!D.isConnected(n)) return INT_MAX;\n        return ans;\n    }\n\n    vector<vector<int>> findCriticalAndPseudoCriticalEdges(int n, vector<vector<int>>& edges) {\n        for(int i=0;i<edges.size();i++) edges[i].push_back(i);\n        sort(edges.begin(),edges.end(),comp);\n        int mst = getMSTCost(n,edges,-1,-1);\n        vector<vector<int>> ans(2);\n        for(int i=0;i<edges.size();i++) {\n            int new_mst = getMSTCost(n,edges,i,-1);\n            if (new_mst>mst) ans[0].push_back(edges[i][3]); \n            else{\n                new_mst  = getMSTCost(n,edges,-1,i);\n                if (new_mst == mst) ans[1].push_back(edges[i][3]);\n            }\n        }\n        return ans;\n    }\n};\n```\n\n### Hope this solution helped you! If it did, dont forget to upvote as a token of gratitude! Cheers!
['Union Find', 'Sorting', 'Minimum Spanning Tree', 'Strongly Connected Component', 'C++']