question 1
The method runs on oooeezz. How many characters has it written just after it reads the first z?
the answer, and why
the answer is C
Reading the first e ended ooo, so 3o. Reading the first z ended ee, so 2e. 3o2e is 4 characters; zz is written only at the end.
if you chose another
- That is 3o alone. Reading the first z also writes ee's run, 2e.
- That is the whole code, 3o2e2z. The last run is written only at the end.
- That counts the runs met so far, ooo, ee and z. Only runs that have ended are written.