Why do we do inc[i] + dec[i] - 1?

I am not able to understand why we do this to get the answer?

hey @Deepanshu_garg, read the question properly and dry run this code once with this logic. inc[i] + dec[i] - 1 is the main logic here to get max length bitonic subarray.