Help with logic please
Help with logic please
Hey @ritvikagrawal1, the question is a bit confusing. Let me clear it out for you. It says that a sequence can be of following cases :
- Only increasing sequence
- Only decreasing sequence
- Increasing and then decreasing sequence
- Decreasing and then increasing sequence
You have to write the code such that when your input sequence is any of 1,2,4…the output should be true. Else for case 3, the output should be false.
Also take care of the case when two consecutive numbers in the sequence appear to be the same. In this case again the output should false
Hope this breaks down the logic into simple steps so that you can implement.
Happy Coding 
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.