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 nums = &nums;
while end < len - 1 {
end += 1;
for i in 0..len {
end = i;
if nums[end as usize] == 0 {
k -= 1;
}