Print a triangle of numbers from a given input
I'm trying to get an output of the following a right triangle with a hollow middle and a right triangle with numbers :
*
**
* *
* *
* *
* *
* *
********
and
1
12
123
1234
12345
123456
1234567
12345678
Here is my code so far
import kotlin.io.*
fun main() {
print("Enter an integer: ")
val n = readLine()!!.toInt()
var i = 1
while (i