question 1
The method runs on qqbooo. How many characters has it written just after it reads the first o?
the answer, and why
the answer is D
Reading the first b ended qq, so 2q. Reading the first o ended b, so 1b. 2q1b is 4 characters; ooo is written only at the end.
if you chose another
- That is 2q alone. Reading the first o also writes b's run, 1b.
- That is the whole code, 2q1b3o. The last run is written only at the end.
- That counts the runs met so far, qq, b and o. Only runs that have ended are written.