question 1
The method runs on ytto. How many characters has it written just after it reads the first o?
the answer, and why
the answer is A
Reading the first t ended y, so 1y. Reading the first o ended tt, so 2t. 1y2t is 4 characters; o is written only at the end.
if you chose another
- That is 1y alone. Reading the first o also writes tt's run, 2t.
- That is the whole code, 1y2t1o. The last run is written only at the end.
- That counts the runs met so far, y, tt and o. Only runs that have ended are written.