[Python] 5-line Combinations, O(K) Space
Using existing genorator combinations.\n\nPython:\npython\nclass CombinationIterator(object):\n\n    def __init__(self, A, k):\n        self.it = itertools.comb
Using existing genorator `combinations`.\n\n**Python:**\n```python\nclass CombinationIterator(object):\n\n    def __init__(self, A, k):\n        self.it = itertools.combinations(A, k)\n        self.last = A[-k:]\n        self.hasNext = lambda: True\n\n    def next(self):\n        res = \'\'.join(self.it.next())\n        self.hasNext = lambda: res != self.last\n        return res\n```
[]