title: Longest Common Increasing Subsequence Lcs Lis
signature: func longestCommonIncreasingSubsequenceLcsLis(arr1 []int, n int, arr2 []int, m int) int {
source_py: def longest_common_increasing_subsequence_lcs_lis(arr1, n, arr2, m):
      table = ([0] * m)
      for j in range(m):
          table[j] = 0
      for i in range(n):
          current = 0
          for j in range(m):
              if (arr1[i] == arr2[j]):
                  if ((current + 1) > table[j]):
                      table[j] = (current + 1)
              if (arr1[i] > arr2[j]):
                  if (table[j] > current):
                      current = table[j]
      result = 0
      for i in range(m):
          if (table[i] > result):
              result = table[i]
      return result
source_cpp: int longest_common_increasing_subsequence_lcs_lis(vector<int> arr1, int n, vector<int> arr2, int m) {
    int table [ m ];
    for ( int j = 0;
    j < m;
    j ++ ) table [ j ] = 0;
    for ( int i = 0;
    i < n;
    i ++ ) {
      int current = 0;
      for ( int j = 0;
      j < m;
      j ++ ) {
        if ( arr1 [ i ] == arr2 [ j ] ) if ( current + 1 > table [ j ] ) table [ j ] = current + 1;
        if ( arr1 [ i ] > arr2 [ j ] ) if ( table [ j ] > current ) current = table [ j ];
      }
    }
    int result = 0;
    for ( int i = 0;
    i < m;
    i ++ ) if ( table [ i ] > result ) result = table [ i ];
    return result;
  }