Search
⌘K

Leetcode 1286. Iterator for Combination

Implement an iterator that, given a sorted string of distinct lowercase letters and an integer k, returns all length-k combinations in lexicographic order via next() and hasNext(). The iterator must efficiently maintain state for up to characters.length ≤ 15 and at most 10^4 calls, producing each combination on demand.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.