C++ Solution
Approach\n Describe your approach to solving the problem. \n    Disjoint Set Union (DSU)\n\n# Code\n\nclass Solution {\npublic:\n    int par[26];\n    int find_
# Approach\n<!-- Describe your approach to solving the problem. -->\n    Disjoint Set Union (DSU)\n\n# Code\n```\nclass Solution {\npublic:\n    int par[26];\n    int find_rep(int u) {\n        if(par[u] == -1) return u;\n        return par[u]= find_rep(par[u]);\n    }\n    void make_union(int u, int v) {\n        u = find_rep(u);\n        v = find_rep(v);\n        if(u!=v) par[max(u, v)] = min(u, v); \n    }\n    string smallestEquivalentString(string s1, string s2, string baseStr) {\n        memset(par, -1, sizeof(par));\n        for(int i=0; i<s1.size(); i++) make_union(s1[i] - \'a\', s2[i] - \'a\');\n        int n = baseStr.size();\n        string ans(n, \'.\');\n        for(int i=0; i<n; i++) ans[i] = find_rep(baseStr[i] - \'a\') + \'a\';\n        return ans;\n    }\n};\n```
['C++']