k
distinct integers.left1
and left2
, to the start of the array.j
.j
, expand the window by including nums[j]
and update the counter.k
, move left1
or left2
to reduce the window size.k
and at most k-1
distinct integers.k
distinct integers.