✅ 0ms runtime | 100% fastest | C++
C++ Solution\n\nC++ []\nclass Solution {\npublic:\n    int par[26];\n    \n    int find(int x){\n        if(par[x]==-1) return x;\n        return par[x]=find(pa
## C++ Solution\n\n``` C++ []\nclass Solution {\npublic:\n    int par[26];\n    \n    int find(int x){\n        if(par[x]==-1) return x;\n        return par[x]=find(par[x]);\n    }\n    \n    void Union(int x, int y) {\n        x = find(x);\n        y = find(y);\n        \n        if (x != y) \n            par[max(x, y)] = min(x, y); \n    }\n\t\n    string smallestEquivalentString(string s1, string s2, string baseStr) {\n        \n        memset(par, -1, sizeof(par));\n        \n        for (auto i = 0; i < s1.size(); ++i) \n            Union(s1[i] - \'a\', s2[i] - \'a\');\n        \n        for(auto i=0;i<baseStr.size();i++) \n            baseStr[i]=find(baseStr[i]-\'a\')+\'a\';\n\n        return baseStr;\n    }\n};\n```\n\n*Upvote if helped*
['C++']