title: Check Array Represents Inorder Binary Search Tree Not
signature: check_array_represents_inorder_binary_search_tree_not <- 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(2L, 3L, 4L, 10L, 11L, 13L, 17L, 19L, 23L, 26L, 28L, 29L, 30L, 34L, 35L, 37L, 38L, 38L, 43L, 49L, 49L, 50L, 52L, 53L, 55L, 55L, 57L, 58L, 58L, 59L, 64L, 66L, 67L, 70L, 72L, 72L, 75L, 77L, 77L, 87L, 89L, 89L, 90L, 91L, 98L, 99L, 99L, 99L), 46L, 
          TRUE
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          list(56L, -94L, -26L, -52L, 58L, -66L, -52L, -66L, -94L, 44L, 38L, -66L, 70L, -70L, -80L, -78L, -72L, -60L, -76L, 68L, -50L, 32L, -16L, 84L, 74L, -42L, 98L, -8L, 72L, 26L, 24L, 6L, 24L, 86L, 86L, 78L, -92L, 80L, 32L, -74L, 26L, 50L, 92L, 4L, 2L, -34L, -2L, -18L, -10L), 30L, 
          FALSE
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          list(0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), 13L, 
          TRUE
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          list(38L, 79L, 76L, 92L, 92L), 2L, 
          TRUE
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          list(-42L, -28L, 2L, 32L, 50L, 56L, 86L, 96L, 98L), 7L, 
          TRUE
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          list(1L, 0L, 0L, 1L, 1L, 1L, 0L, 1L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), 11L, 
          FALSE
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          list(1L, 9L, 12L, 21L, 21L, 24L, 34L, 55L, 60L, 63L, 67L, 68L, 88L, 89L, 91L, 94L, 98L, 99L), 9L, 
          TRUE
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          list(-96L, 96L, -98L, -42L, -74L, 40L, 42L, 50L, -46L, -52L, 8L, -46L, 48L, 88L, -78L, -72L, -10L, -20L, 98L, -40L, -18L, 36L, 4L, 46L, 52L, 28L, -88L, -28L, -28L, -86L), 29L, 
          FALSE
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          list(0L, 0L, 0L, 0L, 1L, 1L), 3L, 
          TRUE
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          list(66L, 12L, 48L, 82L, 33L, 77L, 99L, 98L, 14L, 92L), 7L, 
          FALSE
      )))
  
  }
  
  main()
source_py: def check_array_represents_inorder_binary_search_tree_not(arr, n):
      if ((n == 0) or (n == 1)):
          return True
      for i in range(1, n, 1):
          if (arr[(i - 1)] > arr[i]):
              return False
      return True
source_cpp: bool check_array_represents_inorder_binary_search_tree_not(vector<int> arr, int n) {
    if ( n == 0 || n == 1 ) return true;
    for ( int i = 1;
    i < n;
    i ++ ) if ( arr [ i - 1 ] > arr [ i ] ) return false;
    return true;
  }