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 7bb885b commit 48e3748Copy full SHA for 48e3748
geek_for_geeks/challenge/move_zero.py
@@ -0,0 +1,11 @@
1
+def pushZerosToEnd(arr):
2
+ count = 0
3
+ n = len(arr)
4
+ for i in range(n):
5
+ if arr[i] != 0:
6
+ arr[count] = arr[i]
7
+ count += 1
8
+ while count < n:
9
+ arr[count] = 0
10
11
+ return arr
0 commit comments