Python, union-find
\nclass Solution:\n    def smallestEquivalentString(self, s1: str, s2: str, baseStr: str) -> str:\n        def find(c):\n            i = ord(c) - ord(\'a\')\n  
```\nclass Solution:\n    def smallestEquivalentString(self, s1: str, s2: str, baseStr: str) -> str:\n        def find(c):\n            i = ord(c) - ord(\'a\')\n            while root[i] != i:\n                i = root[i]\n                \n            return i\n        \n        root = list(range(26))\n        for c1, c2 in zip(s1, s2):\n            r1 = find(c1)\n            r2 = find(c2)\n            if r1 > r2:\n                r1, r2 = r2, r1\n\n            root[r2] = r1\n        \n        return "".join(chr(ord(\'a\') + find(c)) for c in baseStr)\n```
['Python3']