Given an array of integers, write a program Ones.java
to find the maximum number of consecutive 1's present in the array.
e.g,
{1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1} --> 4
{0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1} --> 1
Write a Java program Zeros.java
to move all 0's to the end of an array. Maintain the relative order of the other (non-zero) array elements.