/**
 * Given two times in the format "hh:mm:ss", return their sum in the same format.
 */
fun addTimes(time1: String, time2: String): String {

    // Convert the times into seconds
    val (hours1, minutes1, seconds1) = time1.split(':').map { it.toInt() }
    val (hours2, minutes2, seconds2) = time2.split(':').map { it.toInt() }

    val totalSeconds = (hours1 + hours2) * 3600 + (minutes1 + minutes2) * 60 + seconds1 + seconds2

    // Convert the total seconds back into the format "hh:mm:ss"
    val hours = totalSeconds / 3600
    val minutes = (totalSeconds % 3600) / 60
    val seconds = (totalSeconds % 3600) % 60

    return String.format("%02d:%02d:%02d", hours, minutes, seconds)
}
/**
 * Given two times in the format "hh:mm:ss", return their sum in the same format.
 */
fun addTimes(time1: String, time2: String): String {
/**
 * Given two times in the format "hh:mm:ss", return their sum in the same format.
 */
fun addTimes(time1: String, time2: String): String {

    // Convert the times into seconds
    val (hours1, minutes1, seconds1) = time1.split(':').map { it.toInt() }
    val (hours2, minutes2, seconds2) = time2.split(':').map { it.toInt() }

    val totalSeconds = (hours1 + hours2) * 3600 + (minutes1 + minutes2) * 60 + seconds1 + seconds2

    // Convert the total seconds back into the format "hh:mm:ss"
    val hours = totalSeconds / 3600
    val minutes = (totalSeconds % 3600) / 60
    val seconds = (totalSeconds % 3600) % 60

    return String.format("%02d:%02d:%02d", hours, minutes, seconds)
}