@Valid Invalid Sequence

can’t pass some test case. please help
https://ide.codingblocks.com/#/s/21928

The question statement is
“Compute if it is possible to split sequence into two sequences - s1 to si and si+1 to sN such that first sequence is strictly decreasing and second is strictly increasing.”
You missed out the corner cases. According to the question, the sequence would be valid even if it is totally decreasing or totally increasing.