You can replace both loops with repeat, if you wan...
# getting-started
g
You can replace both loops with repeat, if you want, but not sure that it’s looks better:
Copy code
repeat(5) { i ->
            repeat(i + 1) {
                print("*")
            }
            println()
        }