C++|| Bit Manipulation || 10ms || Well commented || Easy Solution
Upvote if you find this helpful. Comment if you have any doubts. \n\nclass Solution {\npublic:\n    int solve(vector<string> &arr,int i,int vis){\n        if(i=
Upvote if you find this helpful. Comment if you have any doubts. \n```\nclass Solution {\npublic:\n    int solve(vector<string> &arr,int i,int vis){\n        if(i==arr.size()){\n            return 0 ;\n        }\n        int n1 = solve(arr,i+1,vis);\n        int n2 = INT_MIN;\n        bool flag = 0;\n        for(int j = 0;j<arr[i].size();j++){\n            // check if any of the character in ith string is already in the ans using bit manipulation\n            if((vis & (1<<(arr[i][j]-\'a\'))) == (1<<(arr[i][j]-\'a\'))){\n                flag=1;\n                break;\n            }\n            // we include the particular alphabet in the ans\n            else{\n                vis |= (1<<(arr[i][j]-\'a\'));\n            }\n        }\n        // if any of the ith string character is already in the ans, we cannot include that string\n        if(flag){\n            return n1;\n        }\n        // if no characters of ith string are in the ans, we take maximum of including and not including it and return max\n        \n        n2 = arr[i].size()+solve(arr,i+1,vis);\n        return max(n1,n2);\n    }\n    int maxLength(vector<string>& arr) {\n        return solve(arr,0,0);\n        \n    }\n};\n```
['Backtracking', 'Recursion', 'C']