question 1
The method runs on nnbbbeee. How many characters has it written just after it reads the first e?
the answer, and why
the answer is B
Reading the first b ended nn, so 2n. Reading the first e ended bbb, so 3b. 2n3b is 4 characters; eee is written only at the end.
if you chose another
- That is 2n alone. Reading the first e also writes bbb's run, 3b.
- That is the whole code, 2n3b3e. The last run is written only at the end.
- That counts the runs met so far, nn, bbb and e. Only runs that have ended are written.