Suggestion with a modified version of this question

what if we have to print true or false for a series that when it increases it strictly increases and then if it decreases it decreases strictly but not increase decrease increase or decrease increase decrease?

so basically its true if its increase decrease or decrease increase else false. I tried doing but couldnt. I can write a program that gives true for increase decrease or another program that gives true for decrease increase but could not write a single program combining both those conditions. It would be helpful if I could be guided in the proper direction. thanks

Hey @Nitin-Bhattacharyya-2319140631658033
Since u have written the code for them seperately then u can send ur array to check in both cases and if it returns false in both then only your final answer will be false otherwise true

What if I don’t use an array and just compare the recent two inputs and discard the previous value?or is it only possible by using an array?

you have to maintain an array

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.