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