just iterate

This commit is contained in:
Joe Ardent 2024-05-06 14:35:45 -07:00
parent 1c2b0ba376
commit d2df4afd3d

View file

@ -13,8 +13,8 @@ fn l(nums: Vec<i32>, k: i32) -> i32 {
let mut end: i32 = -1; let mut end: i32 = -1;
let nums = &nums; let nums = &nums;
while end < len - 1 { for i in 0..len {
end += 1; end = i;
if nums[end as usize] == 0 { if nums[end as usize] == 0 {
k -= 1; k -= 1;
} }