@quincyhehe Because we stop when groups[i]
is zero, the first k
times the solution runs, there is at most i
choices for nums[i]
when i <= k
.
@LeonCheng Thanks, appreciate it.
@quincyhehe Because we stop when groups[i]
is zero, the first k
times the solution runs, there is at most i
choices for nums[i]
when i <= k
.
@LeonCheng Thanks, appreciate it.
@victorzhang21503 Expected is correct.
@hliu94 @balabasik Extremely sorry about this. The inputs have been changed to be valid, and the question will be rejudged.
@balabasik Some solutions use HashMap instead of array. For an example, please visit https://leetcode.com/articles/degree-of-an-array/ .
@seanzhou1023 The row is guaranteed non-negative. The local column isn't, like in this shape:
_X
XX