Question: You would like to group a list of students by last name and get the total number of groups. Which line of code accomplishes this, assuming you have a list of the Student data class?

  1. `println(students.groupBy{ it.lastName }.count())`
  2. `println(students.groupBy{ it.lastName.first() }.fold().count())`
  3. `println(students.groupingBy{ it.lastName.first() }.count())`
  4. `println(students.groupingBy{ it.lastName.first() }.size())`

Answer: The correct answer of the above question is Option A:`println(students.groupBy{ it.lastName }.count())`