/**
 * You are a teacher and want to add students to the attendance list.
 * Implement a function that takes the existing attendance list and an
 * arbitrary number of students' names as arguments, and returns an updated
 * attendance list. Each student's name should be prefixed with a sequential
 * number indicating their position in the list.
 *
 * @param attendance The existing attendance list.
 * @param students Arbitrary number of students' names.
 * @return Updated attendance list including the new students.
 *
 * Examples:
 * addStudent(listOf("John", "Alice"), "Bob", "Emily")
 * // Returns: listOf("1. John", "2. Alice", "3. Bob", "4. Emily")
 *
 * addStudent(listOf("Michael", "Sophia"), "James", "Olivia", "Benjamin")
 * // Returns: listOf("1. Michael", "2. Sophia", "3. James", "4. Olivia", "5. Benjamin")
 */
fun addStudent(attendance: List<String>, vararg students: String): List<String> {

    val updatedAttendance = students.mapIndexed { index, student ->
        "${index + attendance.size + 1}. $student"
    }
    return attendance + updatedAttendance
}
/**
 * You are a teacher and want to add students to the attendance list.
 * Implement a function that takes the existing attendance list and an
 * arbitrary number of students' names as arguments, and returns an updated
 * attendance list. Each student's name should be prefixed with a sequential
 * number indicating their position in the list.
 *
 * @param attendance The existing attendance list.
 * @param students Arbitrary number of students' names.
 * @return Updated attendance list including the new students.
 *
 * Examples:
 * addStudent(listOf("John", "Alice"), "Bob", "Emily")
 * // Returns: listOf("1. John", "2. Alice", "3. Bob", "4. Emily")
 *
 * addStudent(listOf("Michael", "Sophia"), "James", "Olivia", "Benjamin")
 * // Returns: listOf("1. Michael", "2. Sophia", "3. James", "4. Olivia", "5. Benjamin")
 */
fun addStudent(attendance: List<String>, vararg students: String): List<String> {
/**
 * You are a teacher and want to add students to the attendance list.
 * Implement a function that takes the existing attendance list and an
 * arbitrary number of students' names as arguments, and returns an updated
 * attendance list. Each student's name should be prefixed with a sequential
 * number indicating their position in the list.
 *
 * @param attendance The existing attendance list.
 * @param students Arbitrary number of students' names.
 * @return Updated attendance list including the new students.
 *
 * Examples:
 * addStudent(listOf("John", "Alice"), "Bob", "Emily")
 * // Returns: listOf("1. John", "2. Alice", "3. Bob", "4. Emily")
 *
 * addStudent(listOf("Michael", "Sophia"), "James", "Olivia", "Benjamin")
 * // Returns: listOf("1. Michael", "2. Sophia", "3. James", "4. Olivia", "5. Benjamin")
 */
fun addStudent(attendance: List<String>, vararg students: String): List<String> {

    val updatedAttendance = students.mapIndexed { index, student ->
        "${index + attendance.size + 1}. $student"
    }
    return attendance + updatedAttendance
}