Regarding the error

A particular testcase is failing !!!

Hello @gargshivam2001 you are unnecessarily checking again and again the same logic.
if you find that any point the next element is not greater then the previous that means the array is unsorted and you have tp return false then =.


if you have any doubt you can ask here:
Happy Learning!!

but sir the array could be sorted in dec. order as well !!!

@gargshivam2001 yes you are correct this could be the case but the way you are checking is not the right way and it is not needed in this question i think with the further progress in course you will find one question in which you will see.
if you want to check in this as well then you need to make separate functions for both or you should check for the decreasing while returning from the function.
because the way you are doing will evaluate wrong answer for severak test case becuase in your code if in between the code is in ascending or descending you are checking for that too.
if you have any doubt you can ask here:
Happy Learning!!

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.