title: Convert Strictly Increasing Array Minimum Changes
signature: convert_strictly_increasing_array_minimum_changes <- function(arr, n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(arr, n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(arr, n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          list(1L, 4L, 12L, 14L, 15L, 18L, 20L, 24L, 25L, 25L, 27L, 33L, 34L, 42L, 46L, 48L, 49L, 50L, 50L, 52L, 55L, 56L, 57L, 58L, 64L, 65L, 66L, 69L, 72L, 75L, 78L, 80L, 84L, 90L, 92L, 95L, 99L), 21L, 
          2L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          list(-56L, 6L, -74L, -30L, 34L, 40L, -76L, -10L, -12L, -86L, -76L, 36L, -72L, 82L, 38L, 68L, 28L, 84L, 98L, -84L, 6L, 16L, -46L, 8L, 2L, -18L, -50L, 4L, -96L, 88L, -84L, -38L, -82L, -54L), 22L, 
          15L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          list(0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L), 6L, 
          5L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          list(68L, 79L, 87L, 44L, 3L, 99L, 80L, 6L, 46L, 67L, 72L, 40L, 11L, 18L, 73L, 48L, 18L, 72L, 10L, 38L, 3L, 39L, 26L, 76L, 47L, 15L, 85L, 69L), 15L, 
          10L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          list(-96L, -94L, -94L, -74L, -68L, -60L, -58L, -56L, -56L, -52L, -52L, -50L, -44L, -40L, -26L, -24L, -10L, -8L, -6L, -2L, 2L, 2L, 12L, 14L, 20L, 24L, 26L, 30L, 38L, 40L, 52L, 52L, 62L, 62L, 68L, 70L, 74L, 76L, 80L, 82L, 90L, 92L), 31L, 
          4L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          list(1L, 1L, 1L, 0L, 1L), 3L, 
          2L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          list(1L, 5L, 11L, 20L, 24L, 28L, 29L, 31L, 54L, 58L, 63L, 65L, 66L, 71L, 77L, 80L, 83L, 92L, 93L, 93L), 12L, 
          0L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          list(-50L, -46L, -44L, -90L, 2L, -38L, 88L, -26L, 60L), 7L, 
          2L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          list(1L, 1L), 1L, 
          1L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          list(2L, 1L, 19L, 26L, 65L, 47L, 3L, 65L, 9L, 12L, 84L, 59L, 74L, 59L, 30L, 83L, 73L, 67L, 13L, 5L, 64L, 83L, 81L, 92L, 80L, 14L, 58L, 84L, 92L), 16L, 
          9L
      )))
  
  }
  
  main()
source_py: def convert_strictly_increasing_array_minimum_changes(arr, n):
      LIS = [0 for i in range(n)]
      len = 0
      for i in range(n):
          LIS[i] = 1
      for i in range(1, n):
          for j in range(i):
              if ((arr[i] > arr[j]) and ((i - j) <= (arr[i] - arr[j]))):
                  LIS[i] = max(LIS[i], (LIS[j] + 1))
          len = max(len, LIS[i])
      return (n - len)
source_cpp: int convert_strictly_increasing_array_minimum_changes(vector<int> arr, int n) {
    int LIS [ n ], len = 0;
    for ( int i = 0;
    i < n;
    i ++ ) LIS [ i ] = 1;
    for ( int i = 1;
    i < n;
    i ++ ) {
      for ( int j = 0;
      j < i;
      j ++ ) {
        if ( arr [ i ] > arr [ j ] && ( i - j ) <= ( arr [ i ] - arr [ j ] ) ) {
          LIS [ i ] = max ( LIS [ i ], LIS [ j ] + 1 );
        }
      }
      len = max ( len, LIS [ i ] );
    }
    return n - len;
  }