Increasing Decreasing Sequence

#include
using namespace std;
int main() {
int n, j,i;
int count1 = 0, count2 = 0;
cin>>n;
int S[n];
S[n+1] = 0;
for(i=0; i<n; i++)
{
cin>>S[i];
}
for(i = 0; i<n; i++)
{
j = i+1;

	if(S[i]>S[j]){
		count1 = count1+1;}
	else if(S[i]<S[j]){
		count2 = count2 +1;}
}
if(count1 == n or count2 ==n )
{
	cout<<"true";
}
else
{
	cout<<"false";
}
return 0;

}
/*Where is the problem in my code */
/*when i run the series
10
9
8
7
6
*/
/it gives me the false as a output/

Hello @rajsaxena.personal

Your interpretation of the problem is wrong.
The problem says that print “true” if the given array is first strictly decreasing and then strictly increasing.

Example
6
3 2 1 2 3 4
true

8
1 2 3 4 5 6 7 8
true

5
3 2 1 2 1
false

5
1 2 3 4 5
true

6
1 2 3 4 2 1
false

Let me know if you still need any help.