Please see the code and the indentation
Your code seems correct for most of the part but the issue that i found was that it does not contain a logic for the case when both the previous and the current number are same . For this case 1,2,3,4,4 the output should be false , but in your code the output is true
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.