Cannot Understand for which input my answer will be wrong

In the code i took a sign array which has value 0 if the next no. is array is smaller than current no. , 1 if the next no. is array is greater than current no. and 2 if next no. is equal to current no.
then i just traversed this array and found the answers based on conditions given in question.
Tried a lot of random inputs and its giving correct answer in all.
This is the ide of code:-

Hello @shivanshmittal25,
I think you have missed one important testcase,
i.e. first increasing than decreasing biotonic sequence:

Example,
INPUT:
1
4
1 2 3 2
EXPECTED OUTPUT:
4
YOUR OUTPUT:
3

Correct your code for this testcases and than check it again for all the possible testcases you can think of.
If you still have doubts, feel free to ask.

Hope, this would help.
Give a like, if you are satisfied.

still getting wrong answer even after correction

Example 1:
5
6
12 4 78 90 45 23
8
20 4 1 2 3 4 2 10
1
10
4
10 20 30 40
4
40 30 20 10

Your Output:
5
5
1
6
10

Example 2:
5
1
10
6
12 4 78 90 45 23
8
20 4 1 2 3 4 2 10
4
10 20 30 40
4
40 30 20 10

Your Output:
1
6
1
2
2

Example 3:
5
6
12 4 78 90 45 23
1
10
8
20 4 1 2 3 4 2 10
4
10 20 30 40
4
40 30 20 10

Your Output:
5
1
5
7
10

Study these testcases and correct your code.
I have given enough hint.
Try to resolve it by yourself.
You are not able to solve it, then try a different approach.

In case, you won’t be able to solve it after trying everything, let me know.