mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-11 04:54:51 +08:00
修复1005.K取反后最大化的数组和Java代码K书写错误问题
This commit is contained in:
@ -112,7 +112,7 @@ class Solution {
|
||||
//从前向后遍历,遇到负数将其变为正数,同时K--
|
||||
if (nums[i] < 0 && K > 0) {
|
||||
nums[i] = -nums[i];
|
||||
K--;
|
||||
K--;
|
||||
}
|
||||
}
|
||||
// 如果K还大于0,那么反复转变数值最小的元素,将K用完
|
||||
|
Reference in New Issue
Block a user