🔥 🔥 LIVE CODING and Video Explanation beats 100%  In ENGLISH AND HINDI 🔥 🔥 Java Solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \nMy Approach In English\
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nMy Approach In English\n\nEnglish\nhttps://youtu.be/ivp7eOHIsgY\n\nHindi\n\nhttps://youtu.be/WIuCeY-g3YY\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    int [] letter = new int[26];\n    public String smallestEquivalentString(String s1, String s2, String baseStr) {\n        for(int i=0;i<26;i++){\n            letter[i]=i;\n        }\n        for(int i=0;i<s1.length();i++){\n            unite(s1.charAt(i)-\'a\',s2.charAt(i)-\'a\');\n        }\n        StringBuilder ans = new StringBuilder();\n        for(int i=0;i<baseStr.length();i++){\n            ans.append((char)((get(baseStr.charAt(i)-\'a\'))+\'a\'));\n\n        }\n        return ans.toString();\n        \n    }\n    public void unite(int x,int y){\n        x =get(x);\n        y = get(y);\n        if(x<y){\n            letter[y]=x;\n\n        }else{\n            letter[x]=y;\n        }\n    }\n    public int get(int x){\n        if(letter[x]==x){\n            return x;\n        }\n        else{\n            letter[x]=get(letter[x]);\n            return letter[x];\n        }\n    }\n}\n```
['Java']