Sir i saw the solution of the problem from various website but i dont understand in the final step of this question why we -1 from max of both in from increasing and decreasing

sir i saw the solution of the problem from various website but i dont understand in the final step of this question why we -1 from max of both in from increasing and decreasing

Hey @Aditya-Kushwaha-914550392281281,

Both increasing and decreasing value will account for a common index.
So, that index will be covered or considered twice.
Thus, -1 id done to consider that index only once.