🔴Easy C++ Solution Explained Do upvote🙏🏻
Intuition\n Describe your first thoughts on how to solve this problem. \nTry out all possible sequence of strings from arr which are valid\nand take max size am
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nTry out all possible sequence of strings from arr which are valid\nand take max size among them \n\n# Approach\n<!-- Describe your approach to solving the problem. -->\ntake not take approach each time we have chance to nottake and for take condition should be satisfied. Condition -> if any charcter matches with temp string gathered till now (imlemented with map)\nans current string doesent have repeating charcher(implemented by Bit masking with 28 size)\nDO UPVOTE\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->Exponential\n2^n\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->O(N+N) map+recursive stack\n\nDO UPVOTE\uD83D\uDE4F\uD83C\uDFFB\n\n# Code\n```\nclass Solution {\npublic:\n\n    bool isPossible(map<char,int>&m,string s){\n        bool f = 1;\n        int n = 1<<(29);\n        for(int i = 0; i < s.size(); i++){\n            if(m[s[i]] > 0){\n                f = 0;\n            }\n            if( (n&(1<<(s[i]-\'a\'))) == 0)\n            n = (n|(1<<(s[i]-\'a\')));\n            else f = 0;\n        }\n        return f;\n    }\n    int fun(int ind,map<char,int>&m,int n,vector<string>&arr){\n        if(ind == n)return 0;\n\n        int take = 0;\n        int notTake = 0;\n        notTake = fun(ind+1,m,n,arr);\n        for(int i = ind; i < n; i++){\n            if(isPossible(m,arr[i])){\n                for(int j = 0; j < arr[i].size(); j++)m[arr[i][j]]++;\n                int a = arr[i].size()+fun(i+1,m,n,arr);\n                take = max(take,a);\n                for(int j = 0; j < arr[i].size(); j++)m[arr[i][j]]--;\n            }\n            \n        }\n        return max(take,notTake);\n    }\n    int maxLength(vector<string>& arr) {\n        int n = arr.size();\n        map<char,int>m;\n        return fun(0,m,n,arr);\n    }\n};\n```
['Backtracking', 'Bit Manipulation', 'C++']