Tast case not passing


sample cases are running correct. but when i am submitting i gives all wrong answer.

Hey your code is not satisfying all the testcase:

You have executed it for the inputs of type: first increasing then decreasing.
Please, modify your logic to work with other two types: entirely decreasing and entirely increasing.

Example:
9
1 2 3 4 5 6 7 8 9
In this case fu=n-1.
Thus, size will become 0
Hence, it is returning garbage value.

Modify your code and sharing it with me, test it for three kinds of test cases.
NOTE: You do not have to count for the case: first decreasing than increasing.

Hope, this would help.
If you still have doubts, feel free to ask.
Give a like, if you are satisfied.