✅C++ || Easiest explanation || Beginner friendly || Simple array implementation
Approach\n\n- Make a character array of 26 characters.\n- Initialize all the columns with the same character. i.e. index 0 representing a, 1 representing b and 
# Approach\n\n- Make a character array of 26 characters.\n- Initialize all the columns with the same character. i.e. index `0` representing `a`, `1` representing `b` and so on...\n- Since same index characters of `s1` and `s2` are equal so we\'ll find smaller and bigger characters between two same indexed characters of `s1` & `s2` named as `replace` and `put` respectively.\n- So wherever we\'ll find `replace`(bigger) character in map array we\'ll replace it with the value of `put`(smaller) character in map array.\n- Now our map consist of lexicographically smallest equivalent character of each index.\n- Traverse the `baseStr` and replace all the characters with it\'s smallest equivalent.\n\n \n\n# Complexity\n- Time complexity: O(26*n) == O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(26) == O(1), to create a map array\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n#### You will understand explanation completely after going through code\uD83D\uDC47\n\n# Code\n```\nclass Solution {\npublic:\n    string smallestEquivalentString(string s1, string s2, string baseStr) {\n        char map[26];\n        for(int i=0;i<26;i++){\n            map[i] = i+\'a\';\n        }\n        for(int i=0;i<s1.size();i++){\n            char replace = max(map[s1[i] - \'a\'],map[s2[i] - \'a\']); //Bigger element\n            char put = min(map[s1[i] - \'a\'],map[s2[i] - \'a\']); // Smaller element\n            for(int i=0;i<26;i++){\n                if(map[i] == replace)\n                    map[i] = put;   // Replace all the bigger characters with it\'s smallest equivalent\n            }\n        }\n\n        string ans = "";\n        for(int i=0;i<baseStr.size();i++){\n            ans += map[baseStr[i] - \'a\'];\n        }\n        return ans;\n    }\n};\n```\n\n# Please upvote, if you find this helpful \uD83D\uDE4F \n#### Thank you in advance :)
['C++']