Is the question wrong one?

i have submitted my solution for the same problem , and it got submitted successfully there, but here all test cases are failing . I guess the question is wrong as in sample output we have true as output, so please let me know if the question is wrong or i have to do something else?

@saksham_thukral the question is correct,
also the sample case is
13
1 2 1 3 5 6 4 8 5 7 9 11 10
here peak elements are 2,6,8,11
so the answer is true.

But i guess there won’t be any case in which the array won’t have any peak element, except one if all the elements are same, other wise, if there are different elements, in the array then the array will have peak element in every case as the largest element will of the array will be the peak element so in each case i will return true, except one that is if there are more than 1 element in the array and all the elements are same.
Secondly , according to the solution video, the output is the vector of all the peak element , it not about printing the either true or false as as done for sample test case…

No @saksham_thukral
think of this test:
N=6
5 5 5 4 5 5
here all elements are not same still answer is false,

it is the demand of question just to print True/False,
if you find any element print true else false.

According to me Your case of N=6 and arr = [5 5 5 4 5 5] can’t be possible for this question, as in question they have mentioned that arr[i]!=arr[i+1], so how can this case be possible? That’s why i am saying that it will be true in every case. I have now even tested it , i just input the array and wrote cout<<“true”, and my all test cases were accepted successfully :sweat_smile:

@saksham_thukral yes with given condition of arr[i]!=arr[i+1], answer will be always true!(I didn’t notice the condition)

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.