We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5be5709 commit 64a6fffCopy full SHA for 64a6fff
Algorithms Basics/Chapter 1. Array_String/283. Move Zeroes.cs
@@ -11,7 +11,7 @@ public void MoveZeroes(int[] nums) {
11
}
12
int slow = 0;
13
for (int fast = 0; fast < nums.Length; fast++) {
14
- if (nums[fast] != 0 && fast != slow) {
+ if (nums[fast] != 0 && slow < fast) {
15
while (slow < fast && nums[slow] != 0) {
16
slow++;
17
0 commit comments