TS/JS solution | Beats 100.00%
\n\n\nclass CombinationIterator {\n  result: string[];\n  counter: number;\n\n  constructor(characters: string, combinationLength: number) {\n    this.result = 
![image.png](https://assets.leetcode.com/users/images/e802ff76-629c-4135-a76d-bdfaf9a92115_1717160045.2529755.png)\n\n```\nclass CombinationIterator {\n  result: string[];\n  counter: number;\n\n  constructor(characters: string, combinationLength: number) {\n    this.result = [];\n    this.counter = 0;\n\n    const helper = (cur: string, characters: string) => {\n      if (cur.length >= combinationLength) {\n        this.result.push(cur);\n        return;\n      }\n\n      for (let i = 0; i < characters.length; i++) {\n        helper(cur + characters[i], characters.slice(i + 1));\n      }\n    }\n\n    helper("", characters)\n  }\n\n  next(): string {\n    this.counter++;\n    return this.result[this.counter - 1];\n  }\n\n  hasNext(): boolean {\n    return !!this.result?.[this.counter];\n  }\n}\n```
['TypeScript', 'JavaScript']