✅C++ || Union Find
Code\n\nvector<int> parent(26);\nclass Solution \n{\n    public:\n    int un(int node)\n    {   \n        while(parent[node]!=node) node=parent[node];\n        
# Code\n```\nvector<int> parent(26);\nclass Solution \n{\n    public:\n    int un(int node)\n    {   \n        while(parent[node]!=node) node=parent[node];\n        return node;  \n    }\n    string smallestEquivalentString(string A, string B, string S) \n    {\n        for(int i=0;i<26;i++) parent[i]=i;                      \n        \n        for(int i=0;i<A.size();i++)\n        {\n            int x=un(A[i]-\'a\');\n            int y=un(B[i]-\'a\');\n            \n            if(x!=y) parent[max(x,y)]=min(x,y);\n        }\n        \n        for(int i=0;i<S.length();i++) S[i]=un(S[i]-\'a\')+\'a\';\n        return S;\n    }\n};\n```
['String', 'Union Find', 'C++']