[Python] DFS solution with Explaination
Think in terms of graph. \nINPUT: ["cha", "r", "act", "ers"]\n\nMake a graph for paths starting from each word in input\n\n\n\n1.           "cha"\n\t\t\t/  |  \
Think in terms of graph. \nINPUT: ["cha", "r", "act", "ers"]\n\nMake a graph for paths starting from each word in input\n\n\n```\n1.           "cha"\n\t\t\t/  |  \\\n\t     "r" "act" "ers"\n\t\t /\\     \\\n\t"act" "ers" "ers"\n\t\n\tPATHS (sub-sequences): \n\tcha            - No Duplicates OK : max_len = 3\n\tcha-r          - No Duplicates OK: max_len = 4\n\tcha-r-act      - Duplicate char \'a\' NOTOK\n\tcha-r-ers      - Duplicate char \'r\' NOTOK\n\tcha-act        - Duplicate char \'a\' NOTOK\n\tcha-act-ers    - Duplicate char \'a\',\'c\' NOTOK\n\tcha-ers        - No Duplicates OK: max_len = 6\n```\t\t \n\nSimilarly for other paths starting with "r", "act", "ers"\n```\n2.\t      "r"\n\t\t  /  \\\n\t  "act"   "ers"\n\t  /\n\t  "ers"\n```\n\n\n```\n3.\t  "act"\n\t    |\n\t  "ers"\n```\n\n```\n4.\t  "ers"\n\t  \n```\n\n\nSo, basically you just have to dfs on all words and treat them as starting word of a subsequence.\n\n```\nclass Solution:\n    def __init__(self):\n        self.max_len = 0\n        \n    def dfs(self, arr, curr_subseq, idx):\n        # return if duplicate characters\n        if len(curr_subseq) != len(set(curr_subseq)):\n            return\n        \n        # update max_len if  curr_subseq is maximal\n        self.max_len = max(len(curr_subseq), self.max_len)\n        \n        # dfs on next subseq(s) starting from curr_subseq\n        for i in range(idx, len(arr)):\n            self.dfs(arr, curr_subseq+arr[i], i+1)\n\n    def maxLength(self, arr: List[str]) -> int:\n        if not arr:\n            return 0        \n        \n        self.dfs(arr, "", 0)\n        \n        return self.max_len\n\n    \n\n```
[]