<awangdev>Longest Increasing Continuous subsequence_2.java
public int dfs(int[] A, int[] dp, int[] flag, int i){
        if (flag[i] == 1) {
            return dp[i];
        }
        int ansLeft = 1;
        int ansRight = 1;
        flag[i] = -1;
        if (i - 1 >= 0 && A[i - 1] < A[i] && flag[i - 1] != -1) {
            ansLeft = dfs(A, dp, flag, i - 1) + 1;
        }
        if (i + 1 < A.length && A[i] > A[i + 1] && flag[i + 1] != -1) {
            ansRight = dfs(A, dp, flag, i + 1) + 1;
        }
        flag[i] = 1;
        dp[i] = Math.max(ansLeft, ansRight);
        return dp[i];
    }
public int sample_funcname ( int [ ] A , int [ ] dp , int [ ] flag , int i ) {
  if ( flag [ i ] == 1 ) {
    return dp [ i ] ;
  }
  int ansLeft = 1 ;
  int ansRight = 1 ;
  flag [ i ] = - 1 ;
  if ( i - 1 >= 0 && A [ i - 1 ] < A [ i ] && flag [ i - 1 ] != - 1 ) {
    ansLeft = dfs ( A , dp , flag , i - 1 ) + 1 ;
  }
  if ( i + 1 < A . length && A [ i ] > A [ i + 1 ] && flag [ i + 1 ] != - 1 ) {
    ansRight = dfs ( A , dp , flag , i + 1 ) + 1 ;
  }
  flag [ i ] = 1 ;
  dp [ i ] = Math . max ( ansLeft , ansRight ) ;
  return dp [ i ] ;
}
