Python backtracking easy to understand
\nclass CombinationIterator:\n\n    def __init__(self, characters: str, combinationLength: int):\n        self.combinations = []\n\n        def backtrack(combin
```\nclass CombinationIterator:\n\n    def __init__(self, characters: str, combinationLength: int):\n        self.combinations = []\n\n        def backtrack(combination, i):\n            if len(combination) == combinationLength:\n                self.combinations.append(combination)\n            elif len(combination) < combinationLength:\n                for j in range(i+1, len(characters)):\n                    backtrack(combination + characters[j], j)\n\n        for i in range(len(characters)):\n            backtrack(characters[i], i)\n\n    def next(self) -> str:\n        return self.combinations.pop(0)\n\n    def hasNext(self) -> bool:\n        if self.combinations:\n            return True\n        return False  \n        \n\n\n# Your CombinationIterator object will be instantiated and called as such:\n# obj = CombinationIterator(characters, combinationLength)\n# param_1 = obj.next()\n# param_2 = obj.hasNext()\n```
['Backtracking', 'Python', 'Python3']