Regarding question

In this question the answer will always be “true” and there can never be an array which can not contain a peak. Please correct me if i m wrong.

Yes since we have condition a[i] not equal a[i+1] and a[-1] = a[n+1] = -inf so the answer should be always true.

1 Like

So what is the point of this question as it is totally illogical ?

Some questions may be of this type which just check ur understanding in getting the question.

1 Like