diff --git a/1. Array/push_zero/PushZeroArnab.java b/1. Array/push_zero/PushZeroArnab.java new file mode 100644 index 00000000..5869fbb2 --- /dev/null +++ b/1. Array/push_zero/PushZeroArnab.java @@ -0,0 +1,65 @@ +/** + * PushZero.java + * Given an array of integers,rearrange the array such that all zeroes are at the end without disturbing the orginal + sequence + * Description- + * Take the values of input and check if its non zero or not,If non-zero,then apend them to solution,else count the + No of occurences.The at the end,append the no of zeroes of that count. + * Time Complexity-O(n) Extra Space Complexity-O(1) + * @author [codebook-2000] (https://github.com/codebook-2000) + */ +import java.util.*; +import java.lang.*; +import java.io.*; + +public class PushZeroArnab +{ + static void solve(int arr[],int n) + { + int index=0,j=0; + while(j