static String strBitwiseAND ( String [ ] arr , int n ) {
  String res = "" ;
  int smallest_size = Integer . MAX_VALUE ;
  int largest_size = Integer . MIN_VALUE ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    StringBuilder temp = new StringBuilder ( ) ;
    temp . append ( arr [ i ] ) ;
    arr [ i ] = temp . reverse ( ) . toString ( ) ;
    smallest_size = Math . min ( smallest_size , arr [ i ] . length ( ) ) ;
    largest_size = Math . max ( largest_size , arr [ i ] . length ( ) ) ;
  }
  for ( int i = 0 ;
  i < smallest_size ;
  i ++ ) {
    boolean all_ones = true ;
    for ( int j = 0 ;
    j < n ;
    j ++ ) {
      if ( arr [ j ] . charAt ( i ) == '0' ) {
        all_ones = false ;
        break ;
      }
    }
    res += ( all_ones ? '1' : '0' ) ;
  }
  for ( int i = 0 ;
  i < largest_size - smallest_size ;
  i ++ ) res += '0' ;
  StringBuilder temp = new StringBuilder ( ) ;
  temp . append ( res ) ;
  res = temp . reverse ( ) . toString ( ) ;
  return res ;
}

static String strBitwiseAND ( String [ ] arr , int n ) { String res = " " ; int smallest_size = Integer . MAX_VALUE ; int largest_size = Integer . MIN_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { StringBuilder temp = new StringBuilder ( ) ; temp . append ( arr [ i ] ) ; arr [ i ] = temp . reverse ( ) . toString ( ) ; smallest_size = Math . min ( smallest_size , arr [ i ] . length ( ) ) ; largest_size = Math . max ( largest_size , arr [ i ] . length ( ) ) ; } for ( int i = 0 ; i < smallest_size ; i ++ ) { boolean all_ones = true ; for ( int j = 0 ; j < n ; j ++ ) { if ( arr [ j ] . charAt ( i ) == '0' ) { all_ones = false ; break ; } } res += ( all_ones ? '1' : '0' ) ; } for ( int i = 0 ; i < largest_size - smallest_size ; i ++ ) res += '0' ; StringBuilder temp = new StringBuilder ( ) ; temp . append ( res ) ; res = temp . reverse ( ) . toString ( ) ; return res ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (string_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list)))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list)))))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (false))) (break_statement))))) (expression_statement (assignment_expression left: (identifier) right: (parenthesized_expression (ternary_expression condition: (identifier) consequence: (character_literal) alternative: (character_literal))))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier))) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (identifier) right: (character_literal)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))) (return_statement (identifier))))