Inc dec sequence problem

running on ide but not submitting

Yashika, your code is not working fine for all corner case, for eg when the sequence is purely in decreasing order, like : 5 4 3 2 1 , modify your code .