static int minOperations ( int k ) {
  if ( k <= 0 || k >= 10000 ) return 1000000000 ;
  if ( k == m ) return 0 ;
  dp [ k ] = dp [ k ] ;
  if ( dp [ k ] != - 1 ) return dp [ k ] ;
  dp [ k ] = 1000000000 ;
  dp [ k ] = 1 + Math . min ( minOperations ( 2 * k ) , minOperations ( k - 1 ) ) ;
  return dp [ k ] ;
}

static int minOperations ( int k ) { if ( k <= 0 || k >= 10000 ) return 1000000000 ; if ( k == m ) return 0 ; dp [ k ] = dp [ k ] ; if ( dp [ k ] != - 1 ) return dp [ k ] ; dp [ k ] = 1000000000 ; dp [ k ] = 1 + Math . min ( minOperations ( 2 * k ) , minOperations ( k - 1 ) ) ; return dp [ k ] ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (return_statement (decimal_integer_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (return_statement (decimal_integer_literal))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (unary_expression operand: (decimal_integer_literal)))) consequence: (return_statement (array_access array: (identifier) index: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (decimal_integer_literal) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (decimal_integer_literal) right: (identifier)))) (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal))))))))) (return_statement (array_access array: (identifier) index: (identifier)))))