public void fill(int input[][]){
		boolean row[] = new boolean[input.length];
		boolean col[] = new boolean[input[0].length];
		for(int i=0; i < input.length; i++){
			for(int j=0; j < input[i].length; j++){
				if(input[i][j] == 1){
					row[i] = true;
					col[j] = true;
				}
			}
		}
		for(int i=0; i < input.length; i++){
			for(int j=0; j < input[i].length; j++){
				if(row[i] || col[j]){
					input[i][j] = 1;
				}
			}
		}
	}
http://www.geeksforgeeks.org/a-boolean-matrix-question/
src/com/interview/multiarray/Fill2DMatrixWith1.java