static Pair isEmpty ( char [ ] a ) {
  int num = 0 ;
  int lastposof1 = 0 ;
  int firsposof1 = 0 ;
  boolean flag = true ;
  for ( int i = 0 ;
  i < a . length ;
  i ++ ) {
    if ( a [ i ] == '1' ) {
      num ++ ;
      lastposof1 = i ;
      if ( flag ) {
        firsposof1 = i ;
        flag = false ;
      }
    }
  }
  return new Pair ( num , lastposof1 , firsposof1 ) ;
}

static Pair isEmpty ( char [ ] a ) { int num = 0 ; int lastposof1 = 0 ; int firsposof1 = 0 ; boolean flag = true ; for ( int i = 0 ; i < a . length ; i ++ ) { if ( a [ i ] == '1' ) { num ++ ; lastposof1 = i ; if ( flag ) { firsposof1 = i ; flag = false ; } } } return new Pair ( num , lastposof1 , firsposof1 ) ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (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: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (character_literal))) consequence: (block (expression_statement (update_expression (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (identifier)) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (false))))))))) (return_statement (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier) (identifier) (identifier))))))