C++ || 100% beats || Easy Greedy
\n# Approach \n- Just finding out the minimum value of each alphabet by repetitive updation\n Describe your approach to solving the problem. \n\n# Complexity\n-
\n# Approach \n- Just finding out the minimum value of each alphabet by repetitive updation\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1) \n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    string smallestEquivalentString(string s1, string s2, string bs) {\n        vector<char>v(26);\n        for(char i=\'a\';i<=\'z\';i++) v[i-\'a\']=i;\n        for(int k=0;k<4;k++)\n        for(int i=0;i<s1.size();i++){\n            v[s2[i]-\'a\']=min(v[s1[i]-\'a\'],v[s2[i]-\'a\']);\n            v[s1[i]-\'a\']=min(v[s1[i]-\'a\'],v[s2[i]-\'a\']);\n        }\n        for(int i=0;i<bs.size();i++) bs[i] = v[bs[i]-\'a\'];\n        return bs;\n    }\n};\n```
['C++']