Skip to content

Commit c290fb6

Browse files
authored
Merge pull request #1643 from AkifhanIlgaz/0283
0283
2 parents 1d2dbec + 54e419c commit c290fb6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

rust/0283-move-zeroes.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
impl Solution {
2+
pub fn move_zeroes(nums: &mut Vec<i32>) {
3+
let mut left = 0;
4+
5+
for r in 0..nums.len() {
6+
if nums[r] != 0 {
7+
nums.swap(left, r);
8+
left += 1;
9+
}
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)