C++ Simple Backtracking Solution || Explained
Note that the input string can have duplicate characters too\n\t example: arr = ["accd"]\n take an empty string\n start adding strings from the array\n if the r
* Note that the input string can have duplicate characters too\n\t* example: arr = ["accd"]\n* take an empty string\n* start adding strings from the array\n* if the resulting string is unique \n\t* then update the ans(ans = max length that can be obtained)\n\t* append next string\n* if not backtrack\n\n**Code:**\n\n```\nclass Solution\n{\npublic:\n    int ans = 0;\n    bool isUnique(string s)\n    {\n        set<char> st(s.begin(), s.end());\n        return (st.size() == s.length());\n    }\n    void solve(int index, string s, vector<string> &arr)\n    {\n        if (!isUnique(s))\n            return;\n        ans = max(ans, (int)s.length());\n        for (int i = index; i < arr.size(); i++)\n        {\n            solve(i + 1, s + arr[i], arr);\n        }\n    }\n    int maxLength(vector<string> &arr)\n    {\n        solve(0, "", arr);\n        return ans;\n    }\n};\n```
['Backtracking', 'Depth-First Search', 'Recursion', 'C', 'C++']