public static void main(String args[]) {
        int input[] = {0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1};
        Flip0sMaximum1s fm = new Flip0sMaximum1s();
        System.out.print(fm.flip0sToMaximizeConsecutive1s(input, 1));
    }
Date 12/29/2015
@author Tushar Roy

Given input array of 0s and 1s and number of flips allowed from 0 to 1, what is maximum consecutive 1s we can have
in array

Time complexity - O(n)
Space complexity - O(1)

http://www.geeksforgeeks.org/find-zeroes-to-be-flipped-so-that-number-of-consecutive-1s-is-maximized/
src/com/interview/array/Flip0sMaximum1s.java