nums
with integers from 0 to combinationLength - 1
.getNextCombination
that updates nums
to the next combination.getNextCombination
, find the rightmost index j
where nums[j]
can be incremented.nums[j]
and adjust the subsequent indices to form the next lexicographical combination.next()
, convert the indices in nums
to the corresponding string and call getNextCombination
.hasNext()
, return whether the current combination is not the last one.