question 1
The method runs on dddeey. How many characters has it written just after it reads the first y?
the answer, and why
the answer is D
Reading the first e ended ddd, so 3d. Reading the first y ended ee, so 2e. 3d2e is 4 characters; y is written only at the end.
if you chose another
- That is 3d alone. Reading the first y also writes ee's run, 2e.
- That is the whole code, 3d2e1y. The last run is written only at the end.
- That counts the runs met so far, ddd, ee and y. Only runs that have ended are written.