Here in this question it is given that foe input we have to use array but in the explanation portion it is asking not to use array

Given an array S of size N , check 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
First line contains a single integer N denoting the size of the input.
Next N lines contain a single integer each denoting the elements of the array S.

Constraints
0 < N < 1000 Each number in sequence S is > 0 and < 1000000000

Output Format
Print boolean output - “true” or “false” defining whether the sequence is increasing - decreasing or not.

Sample Input
5
1
2
3
4
5
Sample Output
true
Explanation
Carefully read the conditions to judge which all sequences may be valid. Don’t use arrays or lists.

Hello Shubham,
Here you have to just take simple input, not in the array. You can use for loop for this.
All you have to do check whether it is decreasing or increasing if it is decreasing then it must decrease till the end or up to a point and if it is increasing then it must increase till the end or up to a point.

can you elaborate it properly

Hello Subham in this question you have to just take input from using for loop and check wheather they are in increasing or decreasing or not. for example user give values 1,2,3,4,5 then we can see that it is strictly increasing similary if number are in decresing order then also we print true but if user gives values like 1 21 41 51 61 in this it is not increasing regularly so output is false. Hope now question will be clear to you

yes my doubt is cleared but how to take n number of inputs without using array or array lists???

just use a for loop like:- for(int i=0; i<=n;i++){
int num = scn.nextInt();
}
here n is number of inputs we want to take.
I Hope your doubt is solved now!!!

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.