✅C++|| Recursion || Easy Solution || Concise Solution
\nclass Solution {\npublic:\n    bool compare(vector<int> &selected,string &currString){\n        vector<int> selfCheck(26,0);\n        for(int i=0;i<currString
```\nclass Solution {\npublic:\n    bool compare(vector<int> &selected,string &currString){\n        vector<int> selfCheck(26,0);\n        for(int i=0;i<currString.size();i++){\n            if(selfCheck[currString[i] - \'a\'] == 1) return false;\n            selfCheck[currString[i] - \'a\'] = 1;\n        }\n        for(int i=0;i<currString.size();i++){\n            if(selected[currString[i]-\'a\'] == 1) return false;\n        }\n        return true;\n    }\n    int f(int i,vector<string> &arr,vector<int> &selected,int len){\n        if(i == arr.size()){\n            return len;\n        }\n        string currString = arr[i];\n        if(compare(selected,currString) == false){\n            return f(i+1,arr,selected,len);\n        }\n        else\n        {\n            //pick\n            for(int j=0;j<currString.size();j++){\n                selected[currString[j]-\'a\'] = 1;\n            }\n            len += currString.size();\n            int op1 = f(i+1,arr,selected,len);\n            \n            //skip\n            for(int j=0;j<currString.size();j++){\n                selected[currString[j]-\'a\'] = 0;\n            }\n            len -= currString.size();\n            int op2 = f(i+1,arr,selected,len);\n            \n            return max(op1,op2);\n        }\n    }\n    int maxLength(vector<string>& arr) {\n        vector<int> selected(26,0);\n        return f(0,arr,selected,0);\n    }\n};\n```\n**Please upvote if it was helpful for you, thank you!**
['String', 'Recursion', 'C']