✔️CLEAN EASY RECURSIVE SOLUTION || FULLY EXPLAINED WITH COMMENTS
\nclass Solution\n{\n    public:\n    int ans = 0;\t//to calculate the length of the final target string \n    string temp = "";\n    /*we are using global vari
```\nclass Solution\n{\n    public:\n    int ans = 0;\t//to calculate the length of the final target string \n    string temp = "";\n    /*we are using global variable to maintain states of the string used in recursive dfs\n    WHY? because passing string copies in the recursive calls takes space and memory which can lead to TLE, hence\n    we\'re avoiding that by pushing on nd popping off the global string as required to explore all states\n                                 DONT WORRY...explained below*/\n\n    void dfs(int i, vector<string> &arr)\n    {\n        if (i == arr.size())\n        {\n            /*BASE case, read this after reading below the recursive calls*/\n            /*after all exploration we hav reached the end of the vector of strings, no new strings to add, hence we check the length of\n            our final target string satisfying all criteria which we got this path of exploration\n            we will get different target strings due to different paths of recursive exploration, we store the maximum of all target strings*/\n            if (ans < temp.size()) ans = temp.size();\n            return;\t// we return coz no more strings in vector of strings to add\n        }\n        /*say we are standing at i\'th index of vector of string....means we are standing at some string which \n        we can add to our temp string*/\n\n        /*now there can be 2 possibilties, we can add the i\'th string or not add move to the i+1\'th string in recursive call\n        let us explore both, starting with add case */\n\n        /*but lets check wether such addition is valid or not and then we add*/\n        if (check(temp + arr[i]))\n        {\n            /*so now we add, that to our temp string and use that for later recursive calls, but wait we should save\n            state of temp, WHY? I\'ll explain do it now*/\n            string t = temp;\n            temp += arr[i];\n            dfs(i + 1, arr);\t//using new temp for exploration in the recursive calls\n            /*now we have returned from the recursive exploration, so now we have to explore the not add case, where we dont consider the i\'th string\n            but we need the old temp string for that exploration, not the new temp we used for add case...hence we reassign temp to its old value \n            and use it for not add case */\n            temp = t;\n        }\n        dfs(i + 1, arr);\t//exploring not add case\n    }\n\t\n\tbool check(string s)\n    {\n        /*say we concat two strings as per question....but we need to check wether that new string  is valid or     \n        not, hence we use a vector to maintain frequency of the alphabets, anytime we encounter a character already\n        having frequncy 1, means we have previously encountered, hence return false */\n        vector<int> hash(26, 0);\n        for (auto &i: s) if (hash[i - \'a\']++) return false;\n        return true;\t//otherwise its valid string\n    }\n\t\n    int maxLength(vector<string> &arr)\n    {\n       \t//recursive call to explore all possibilities of addition to the global empty string temp\n        dfs(0, arr);\n        return ans;\t//after the call, our answer is stored in ans variable\n    }\n};\n```
['Backtracking', 'Recursion', 'C']