easy and clean code
\nclass Solution {\n    public int find(int ch, int[] parent)\n    {\n        if(parent[ch] == -1)\n            return ch;\n        return find(parent[ch], pare
```\nclass Solution {\n    public int find(int ch, int[] parent)\n    {\n        if(parent[ch] == -1)\n            return ch;\n        return find(parent[ch], parent);\n    }\n    public void Union(int ch1, int ch2, int[] parent)\n    {\n        int p_ch1 = find(ch1, parent);\n        int p_ch2 = find(ch2, parent);\n        \n        if(p_ch1 != p_ch2)\n        {\n            int max_p = Math.max(p_ch1, p_ch2);\n            int min_p = Math.min(p_ch1, p_ch2);\n            \n            parent[max_p] = min_p;\n        }\n            \n    }\n    public String smallestEquivalentString(String s1, String s2, String baseStr) {\n        int parent[] = new int[26];\n        for(int i = 0; i < 26; i++)\n        {\n            parent[i] = -1;\n        }\n        int n = s1.length();\n        for(int i = 0; i < n; i++)\n        {\n            Union(s1.charAt(i)-\'a\', s2.charAt(i)-\'a\', parent);\n        }\n        n = baseStr.length();\n        String ans = new String();\n        for(int i = 0; i < n; i++)\n        {\n            char ch = (char) (find(baseStr.charAt(i)-\'a\', parent) + \'a\');\n            \n            ans += ch;\n        }\n        return ans;\n    }\n}\n```
['Java']