question 1
The method runs on bqqqmm. How many characters has it written just after it reads the first m?
the answer, and why
the answer is A
Reading the first q ended b, so 1b. Reading the first m ended qqq, so 3q. 1b3q is 4 characters; mm is written only at the end.
if you chose another
- That is 1b alone. Reading the first m also writes qqq's run, 3q.
- That is the whole code, 1b3q2m. The last run is written only at the end.
- That counts the runs met so far, b, qqq and m. Only runs that have ended are written.