python using generator
\nclass CombinationIterator:\n\n    def __init__(self, characters: str, combinationLength: int):\n        def combinations(cur, idx):\n            if len(cur) =
```\nclass CombinationIterator:\n\n    def __init__(self, characters: str, combinationLength: int):\n        def combinations(cur, idx):\n            if len(cur) == combinationLength:\n                yield \'\'.join(cur)\n                return\n            for i in range(idx, len(characters)):\n                cur.append(characters[i])\n                yield from combinations(cur, i + 1)\n                cur.pop()\n        self.combos = combinations([], 0)\n        self.current = True\n        self.hasNextCalled = False\n                \n        \n\n    def next(self) -> str:\n        if self.hasNext():\n            self.hasNextCalled = False\n            return self.current\n        \n\n    def hasNext(self) -> bool:\n        if self.current and not self.hasNextCalled:\n            self.hasNextCalled = True\n            self.current = next(self.combos, False)\n        return bool(self.current)\n```
[]