Failed Test Cases

What is wrong with this code.

when the sequence is first strictly decreasing then strictly increasing.
For example :
9 5 2 7 10
The sequence first decreases starting from 9 to 2 - { 9, 5, 2 } and then starts increasing - { 7, 10}. Note that it can also be broken as { 9, 5} and { 2, 7, 10} .
Since the sequence fulfills the required condition , we would also print “true” for this.

1 Like