List of students' grades

Report a typo

You have a list of students' grades from your class. Each student has two grades. Return a list made up of lists of each student's grades. Possibly, the last student has only one grade. You must take that into account to produce the result.

Sample Input 1:

5.5 4.6 3.0 2.5 10.0 9.9 8.75

Sample Output 1:

[[5.5, 4.6], [3.0, 2.5], [10.0, 9.9], [8.75]]
Write a program in Kotlin
fun main() {
val list = readln().split(" ")
// write your code here

}
___

Create a free account to access the full topic