Skip to content

Commit ce3d232

Browse files
committed
Update challenges.md
1 parent 1ed53b5 commit ce3d232

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/arrays/challenges.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,11 @@ void main() {
7878
7979
// -----------
8080
char[] toPrint = name;
81-
IO.print(toPrint[0]);
82-
IO.print(toPrint[1]);
83-
IO.print(toPrint[2]);
84-
IO.print(toPrint[3]);
81+
int index = 0;
82+
while (index < toPrint.length) {
83+
IO.print(toPrint[index]);
84+
index++;
85+
}
8586
IO.println();
8687
}
8788
```

0 commit comments

Comments
 (0)