-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Hi, there is an error in collections-loops implementation.
At while loop, the incrementation of variable "i" must be outside of while loop or should be implemented differently.
Because, if the condition in while loop is not met, the "i" is not incremented and causes it to work incorrectly.
I think this is the correct solution:
var i = 0
while (i < randoms.size) {
if (randoms[i] <= 10) { //it is mentioned less than or equal to 10 in challenge
println(randoms[i])
}
i++
}
Metadata
Metadata
Assignees
Labels
No labels