is it possible to solve this ques without arrays as it is given under fundamentals and we cannot check inputs for increasing or decreasing without storing them?
Increasing Decreasing sequence Jul 10
Hello @Prateek-Sengar-2189285757790830,
Yes, you can do this without array…
It will require O(1) space.
All you have to do is to store the number before the current input in the sequence and compare. Perform the same for all the numbers.
Hope, this would help.
Give a like, if you are satisfied.
1 Like
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.