private static void getFinalCost ( int [ ] finalCostArr , int size , int ind , String currentVitamins , int currentVitaminCost , String [ ] vitaminArr ) {
  if ( ind >= size ) {
    if ( currentVitamins . contains ( "A" ) && currentVitamins . contains ( "B" ) && currentVitamins . contains ( "C" ) ) finalCost = Math . min ( currentVitaminCost , finalCost ) ;
    return ;
  }
  getFinalCost ( finalCostArr , size , ind + 1 , currentVitamins + vitaminArr [ ind ] , currentVitaminCost + finalCostArr [ ind ] , vitaminArr ) ;
  getFinalCost ( finalCostArr , size , ind + 1 , currentVitamins , currentVitaminCost , vitaminArr ) ;
}

private static void getFinalCost ( int [ ] finalCostArr , int size , int ind , String currentVitamins , int currentVitaminCost , String [ ] vitaminArr ) { if ( ind >= size ) { if ( currentVitamins . contains ( " A " ) && currentVitamins . contains ( " B " ) && currentVitamins . contains ( " C " ) ) finalCost = Math . min ( currentVitaminCost , finalCost ) ; return ; } getFinalCost ( finalCostArr , size , ind + 1 , currentVitamins + vitaminArr [ ind ] , currentVitaminCost + finalCostArr [ ind ] , vitaminArr ) ; getFinalCost ( finalCostArr , size , ind + 1 , currentVitamins , currentVitaminCost , vitaminArr ) ; }
(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)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal)))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal))))) consequence: (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier)))))) (return_statement))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)) (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))) (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))) (identifier)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier) (identifier) (identifier))))))