Did not understand how to solve (maximum length of bitonic array)

could you please tell me how is this approach working…i am not able to understand

You can make 2 array, one inc, that will have at ith position :the length of the increasing sequence till i, similary a dec array that will have: the length of decreasing sequence till ith (ith till n).
For inc array compute the sequence length from left to right
For dec array compute the sequence length from right to left.
Now for every i you have both increasing length till that point and decreasing length to get answer.
Eg
1 6 8 9 3 4 6 5
inc array
1 2 3 4 1 2 3 1
explanation : arr[0] is starting element so 1
arr[1]>arr[0] so inc[1]=1+inc[0] =2
arr[2]>arr[1] so inc[2]=1+inc[1]=3
arr[3]>arr[2] so inc[3]=1+inc[2]=4
arr[4]<arr[3] so inc[4]=1
…and so on

dec array
1 1 1 2 1 1 1 2
similarly for decreasing array

Noy inc[i] have increasing length array till i and dec[i] have dec length array till i
So max(inc[i]+dec[i]-1) will be max bitonic length subarray
we are doing -1 because both includes i

max(1+1-1,2+1-1,3+1-1,…)
Ans 4 + 2 -1