### skpro19's blog

By skpro19, history, 5 years ago,

This is the problem .

According to the accepted solution of other coders, the following test case gives a "Yes". But, shouldn't it give a "No" ?

6 1 2 1 1 1 1 1 1 6

Any help would be really appreciated.

• -10

 » 5 years ago, # |   +1 Note that the non-decreasing and the non-increasing sequences are also considered ladders.
•  » » 5 years ago, # ^ |   0 Yeah, I understand that.But the given query is on the range of [1, 6]. In that range, the sequence is [2, 1, 1, 1, 1, 1]. So, it is decreasing, and then non-decreasing/non- increasing. Hence, this doesn't qualify as a ladder. Because the question says, it should satisfy either of the three criteria: It first doesn't decrease, and then doesn't increase. It doesn't decrease It doesn't increase. But, the given is decreasing and then non- decreasing. Hence, it doesn't qualify in either of the three criteria.
•  » » » 5 years ago, # ^ |   +1 "it is decreasing" --> it is non-increasing. Thus point 3 is satisfied.
•  » » » » 5 years ago, # ^ |   0 It is still failing. My submission
•  » » » » » 5 years ago, # ^ |   0 Can you tell your approach?