Computer Science Canada

Question for Dwite#4 Problem 4

Author:  d310 [ Wed Jan 18, 2012 3:54 pm ]
Post subject:  Question for Dwite#4 Problem 4

"At the beginning of a player?s turn, if the blocks form a ladder- a sequence of either non-increasing or non-decreasing heights- that player loses. "

How long of a sequence is needed for a ladder to be formed?
For example:
0 2 2 2 0 is a ladder.

Author:  Cyril [ Wed Jan 18, 2012 4:35 pm ]
Post subject:  RE:Question for Dwite#4 Problem 4

No, "form a ladder" means "are a sequence of non-increasing or non-decreasing heights".

0 2 2 2 0 is not a ladder.
1 2 3 4 3 is not a ladder.

1 2 3 4 5 is a ladder.
5 4 3 2 1 is a ladder.
1 2 2 3 3 is a ladder
1 1 1 1 1 is a ladder.


: