title: Minimum Steps Minimize N Per Given Condition
signature: minimum_steps_minimize_n_per_given_condition <- function(n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          59L, 
          9L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          7L, 
          3L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          90L, 
          13L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          78L, 
          11L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          49L, 
          6L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          15L, 
          6L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          45L, 
          13L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          56L, 
          6L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          7L, 
          3L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          70L, 
          12L
      )))
  
  }
  
  main()
source_py: def minimum_steps_minimize_n_per_given_condition(n):
      table = ([0] * (n + 1))
      for i in range((n + 1)):
          table[i] = (n - i)
      for i in range(n, 0, (- 1)):
          if (not (i % 2)):
              table[(i // 2)] = min((table[i] + 1), table[(i // 2)])
          if (not (i % 3)):
              table[(i // 3)] = min((table[i] + 1), table[(i // 3)])
      return table[1]
source_cpp: int minimum_steps_minimize_n_per_given_condition(int n) {
    int table [ n + 1 ];
    for ( int i = 0;
    i <= n;
    i ++ ) table [ i ] = n - i;
    for ( int i = n;
    i >= 1;
    i -- ) {
      if ( ! ( i % 2 ) ) table [ i / 2 ] = min ( table [ i ] + 1, table [ i / 2 ] );
      if ( ! ( i % 3 ) ) table [ i / 3 ] = min ( table [ i ] + 1, table [ i / 3 ] );
    }
    return table [ 1 ];
  }