Python Generator Solution
Python backtracking solution using Generator.\n\n\n\nclass CombinationIterator:\n\n    def __init__(self, characters: str, combinationLength: int):\n        sel
Python backtracking solution using Generator.\n\n\n```\nclass CombinationIterator:\n\n    def __init__(self, characters: str, combinationLength: int):\n        self.chars = characters\n        self.length = combinationLength\n        def permutation(curr, idx):\n            if len(curr) == self.length:\n                yield curr\n                return\n            for i in range(idx, len(self.chars)):\n                yield from permutation(curr + self.chars[i], i + 1)      \n        self.curr = permutation("", 0)\n        self.cache = ""\n\n    def next(self) -> str:\n        ans = self.cache or next(self.curr)\n        self.cache = ""\n        return ans\n\n    def hasNext(self) -> bool:\n        try:\n            if self.cache: return True\n            self.cache = next(self.curr)\n            return True\n        except:\n            return False\n```
['Backtracking', 'Python']