INCREASING DECREASING SEQUENCE
Take the following as input.
A number (N)
Take N more numerical inputs
The N inputs for a sequence S = s1, s2, …, sN. 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. Print true/false as output.
Input Format:
Constraints:
0 < N < 1000 Each number in sequence S is > 0 and < 1000000000
Output Format
Sample Input
5
1
2
3
4
5
Sample Output
true
sir, i am not getting this questions… what does he want to say? the sample input that they have given should have output false according to me…As 1,2,3,4,5 if we take i=3, then 1,2,3 is incresing sequence and also S(i+1) to S(n) that is 4,5 is also incresing…Please explain me this question so that i can solve it…