static void rowWith0s ( int mat [ ] [ ] ) {
  int max_row_index = 0 , max = Integer . MIN_VALUE ;
  int min_row_index = 0 , min = Integer . MAX_VALUE ;
  int i , index ;
  for ( i = 0 ;
  i < R ;
  i ++ ) {
    index = first ( mat [ i ] , 0 , C - 1 ) ;
    int cntZeroes = 0 ;
    if ( index == - 1 ) {
      cntZeroes = C ;
    }
    else {
      cntZeroes = index ;
    }
    if ( max < cntZeroes ) {
      max = cntZeroes ;
      max_row_index = i ;
    }
    if ( min > cntZeroes ) {
      min = cntZeroes ;
      min_row_index = i ;
    }
  }
  System . out . println ( "Row with min 0s: " + ( min_row_index + 1 ) ) ;
  System . out . println ( "Row with max 0s: " + ( max_row_index + 1 ) ) ;
}

static void rowWith0s ( int mat [ ] [ ] ) { int max_row_index = 0 , max = Integer . MIN_VALUE ; int min_row_index = 0 , min = Integer . MAX_VALUE ; int i , index ; for ( i = 0 ; i < R ; i ++ ) { index = first ( mat [ i ] , 0 , C - 1 ) ; int cntZeroes = 0 ; if ( index == - 1 ) { cntZeroes = C ; } else { cntZeroes = index ; } if ( max < cntZeroes ) { max = cntZeroes ; max_row_index = i ; } if ( min > cntZeroes ) { min = cntZeroes ; min_row_index = i ; } } System . out . println ( " Row ▁ with ▁ min ▁ 0s : ▁ " + ( min_row_index + 1 ) ) ; System . out . println ( " Row ▁ with ▁ max ▁ 0s : ▁ " + ( max_row_index + 1 ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (decimal_integer_literal) (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (unary_expression operand: (decimal_integer_literal)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier)))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (string_literal) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (string_literal) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))))))))