question 1
The method runs on ecccm. How many characters has it written just after it reads the first m?
the answer, and why
the answer is B
Reading the first c ended e, so 1e. Reading the first m ended ccc, so 3c. 1e3c is 4 characters; m is written only at the end.
if you chose another
- That is 1e alone. Reading the first m also writes ccc's run, 3c.
- That is the whole code, 1e3c1m. The last run is written only at the end.
- That counts the runs met so far, e, ccc and m. Only runs that have ended are written.