This book offers Continental Mathematics League
computer science contest questions from 1999 to 2008.
CML has been bringing us fun
competitions in mathematics and computer science for many years.
The annual CML contest in computer science takes place every spring,
shortly before the Advanced Placement exams.
It offers 25 challenging multiple-choice questions for 40 minutes.
The questions mostly stay within the range of the standard AP CS curriculum,
but many of them add an unusual twist or turn,
and it is very difficult to answer all of them correctly
within the allotted time.
With the time limit removed, however, these questions
offer a great opportunity to test your knowledge of the subject,
fill in gaps, gain new insights, and get "heavy-duty" practice for the AP exam.
2001, Question 14:
In the ABBAB language the alphabet has only two letters.
A string of letters (including one-letter strings) is a valid word,
if and only if the isValid
method returns true for that string.
isValid
is defined as follows: