title: Length Longest Strict Bitonic Subsequence
signature: function length_longest_strict_bitonic_subsequence(arr, n)
source_py: def length_longest_strict_bitonic_subsequence(arr, n):
      (inc, dcr) = (dict(), dict())
      (len_inc, len_dcr) = (([0] * n), ([0] * n))
      longLen = 0
      for i in range(n):
          len = 0
          if (inc.get((arr[i] - 1)) in inc.values()):
              len = inc.get((arr[i] - 1))
          inc[arr[i]] = len_inc[i] = (len + 1)
      for i in range((n - 1), (- 1), (- 1)):
          len = 0
          if (dcr.get((arr[i] - 1)) in dcr.values()):
              len = dcr.get((arr[i] - 1))
          dcr[arr[i]] = len_dcr[i] = (len + 1)
      for i in range(n):
          if (longLen < ((len_inc[i] + len_dcr[i]) - 1)):
              longLen = ((len_inc[i] + len_dcr[i]) - 1)
      return longLen
source_cpp: int length_longest_strict_bitonic_subsequence(vector<int> arr, int n) {
    unordered_map < int, int > inc, dcr;
    int len_inc [ n ], len_dcr [ n ];
    int longLen = 0;
    for ( int i = 0;
    i < n;
    i ++ ) {
      int len = 0;
      if ( inc . find ( arr [ i ] - 1 ) != inc . end ( ) ) len = inc [ arr [ i ] - 1 ];
      inc [ arr [ i ] ] = len_inc [ i ] = len + 1;
    }
    for ( int i = n - 1;
    i >= 0;
    i -- ) {
      int len = 0;
      if ( dcr . find ( arr [ i ] - 1 ) != dcr . end ( ) ) len = dcr [ arr [ i ] - 1 ];
      dcr [ arr [ i ] ] = len_dcr [ i ] = len + 1;
    }
    for ( int i = 0;
    i < n;
    i ++ ) if ( longLen < ( len_inc [ i ] + len_dcr [ i ] - 1 ) ) longLen = len_inc [ i ] + len_dcr [ i ] - 1;
    return longLen;
  }