static void min_subarray ( int [ ] a , int n ) {
  Stack < Pair > st = new Stack < Pair > ( ) ;
  for ( int i = 0 ;
  i < n ;
  ++ i ) {
    int count = 1 ;
    while ( st . empty ( ) == false && st . peek ( ) . first > a [ i ] ) {
      count += st . peek ( ) . second ;
      st . pop ( ) ;
    }
    st . push ( new Pair ( a [ i ] , count ) ) ;
    System . out . print ( count + " " ) ;
  }
}

static void min_subarray ( int [ ] a , int n ) { Stack < Pair > st = new Stack < Pair > ( ) ; for ( int i = 0 ; i < n ; ++ i ) { int count = 1 ; while ( st . empty ( ) == false && st . peek ( ) . first > a [ i ] ) { count += st . peek ( ) . second ; st . pop ( ) ; } st . push ( new Pair ( a [ i ] , count ) ) ; System . out . print ( count + " ▁ " ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_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: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (false)) right: (binary_expression left: (field_access object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) field: (identifier)) right: (array_access array: (identifier) index: (identifier))))) body: (block (expression_statement (assignment_expression left: (identifier) right: (field_access object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) field: (identifier)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (identifier)))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (string_literal)))))))))