what are the mean by strictly increasing and strictly decreasing
Increasing Decreasing Sequence
hey @khemchandrs, strictly means that one number should not be equal to next number of the series.
eq: 1 2 3 4 5 5 is increasing, but not strictly increasing, whereas 1 2 3 4 5 6 is strictly increasing…
Similar from decreasing series
1,2,3,4,5 this given series is strictly increasing and strictly decreasing when we spil the series
can you explain about this obove series
@khemchandrs break series in two parts,
eg: {1} and {2,3,4,5} or {1,2,3,4} and {5}
now we have two series, series with 4 element in it can be considered as strictly increasing, and the remaining one just has 1 element so we can consider it as strictly decreasing.
i have lots of confusion send me code of this question
#include using namespace std; int main() { int n; cin>>n; int number=n; int f; cin>>f; if(n==1){ cout<<“false”; return 0; } n–; int c=0; while(n–){ int item; cin>>item; if(item>f) { f=item; c++; } else { f=item; c–; } } if(c==number-1) cout<<“true”; else cout<<“false”; return 0; }
some test give wrong result