how can we reduce the time taken ?
Increasing decreasing sequence
use these observation
a[i]>a[i-1] when sequences is inc it should not decrease after that
a[i]<a[i-1] when sequences is dec it should not increase before
how can we reduce the time taken ?
use these observation
a[i]>a[i-1] when sequences is inc it should not decrease after that
a[i]<a[i-1] when sequences is dec it should not increase before