Problem 1
- Test level
- Multiple choice
- No calculator
- 4 pts
Allowed inputs are nonempty uppercase words. The required output is the entire input enclosed in square brackets. Which rule satisfies every allowed input?
Answer
Output an opening bracket, the whole input, then a closing bracket.
Full solution
The rule must preserve every letter of every allowed word.
Opening bracket, full word, closing bracket does this for every allowed length.
A first-letter rule loses information, a length restriction omits inputs, and two closing brackets use the wrong delimiters.
Where students lose points
Testing one word instead of checking every allowed length.

