[Python] C(n,k) online solution
I saw most of the solutions provided are offline - to generate the C(N, K) list offline in the constructor, and then traverse the offline generated list, which 
I saw most of the solutions provided are **offline** - to generate the C(N, K) list offline in the constructor, and then traverse the offline generated list, which is accepted in the contest. But I want to give the **online** solution here.\n\nIntuition (inspired by [31. Next Permutation](https://leetcode.com/problems/next-permutation/discuss/13867/C%2B%2B-from-Wikipedia)): \n1. Find the last position i which could be replaced with other larger character candidates\n   ```text\n   e.g. curCombination=\'abe\', characters=\'abcde\', k=3\n   We traverse from tail.\n   \'e\' is the largest char among characters;\n   \'b\' has other options like \'c\', \'d\' (Note: \'e\' is not an option for \'b\')\n   ```\n2. Set all characters from position i until k using candidates pool in lex order\n   `In example above, \'be\' -> \'cd\' because c is the next available candidate after \'b\'`\n\n```python\nclass CombinationIterator:\n\n    def __init__(self, characters: str, combinationLength: int):\n        self.charset = characters\n        self.n = len(characters)\n        self.k = combinationLength\n        self._next = list(characters)[:self.k]\n        self._hasNext = True\n\n    def next(self) -> str:\n        if not self._hasNext:\n            return \'\'\n        prev = \'\'.join(self._next)\n        n, k = self.n, self.k\n        for i in range(k-1, -1, -1):\n            d = self.charset.find(self._next[i])\n            # if there is other candidates at this char position, reset _next[i:k] to candidates[i\':i\'+k-i]\n            if d < n-k+i:\n                # reset chars in order from i until k\n                next_cand_idx = self.charset.find(self._next[i]) + 1 # next available candidate index\n                end = next_cand_idx + k - i\n                self._next[i:] = list(self.charset[next_cand_idx:end])\n                return prev\n        self._hasNext = False\n        return prev\n        \n    def hasNext(self) -> bool:\n        return self._hasNext\n```
['Python']