Skip to content

Commit e852d9d

Browse files
authored
Update Solution.java
1 parent 5cbf00d commit e852d9d

File tree

1 file changed

+1
-1
lines changed
  • src/main/java/g3001_3100/s3086_minimum_moves_to_pick_k_ones

1 file changed

+1
-1
lines changed

src/main/java/g3001_3100/s3086_minimum_moves_to_pick_k_ones/Solution.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public long minimumMoves(int[] nums, int k, int maxChanges) {
2121
maxAdjLen = Math.min(3, Math.max(maxAdjLen, r - l));
2222
if (maxAdjLen + maxChanges >= k) {
2323
if (maxAdjLen >= k) {
24-
return k - 1;
24+
return k - 1L;
2525
} else {
2626
return Math.max(0, maxAdjLen - 1) + (k - maxAdjLen) * 2L;
2727
}

0 commit comments

Comments
 (0)