/**
 * Given a list of musicians where each musician is represented by a tuple of their name (string),
 * age (integer), and instrument (string), this function calculates and returns the average age of all musicians.
 *
 * Example:
 * getAverageAge(listOf(Triple("John", 25, "guitar"), Triple("Emily", 29, "piano"), Triple("Max", 32, "drums")))
 * Output: 28.666666666666668
 */
fun getAverageAge(musicians: List<Triple<String, Int, String>>): Double {

    val totalAge = musicians.sumBy { it.second }
    return totalAge.toDouble() / musicians.size
}
/**
 * Given a list of musicians where each musician is represented by a tuple of their name (string),
 * age (integer), and instrument (string), this function calculates and returns the average age of all musicians.
 *
 * Example:
 * getAverageAge(listOf(Triple("John", 25, "guitar"), Triple("Emily", 29, "piano"), Triple("Max", 32, "drums")))
 * Output: 28.666666666666668
 */
fun getAverageAge(musicians: List<Triple<String, Int, String>>): Double {
/**
 * Given a list of musicians where each musician is represented by a tuple of their name (string),
 * age (integer), and instrument (string), this function calculates and returns the average age of all musicians.
 *
 * Example:
 * getAverageAge(listOf(Triple("John", 25, "guitar"), Triple("Emily", 29, "piano"), Triple("Max", 32, "drums")))
 * Output: 28.666666666666668
 */
fun getAverageAge(musicians: List<Triple<String, Int, String>>): Double {

    val totalAge = musicians.sumBy { it.second }
    return totalAge.toDouble() / musicians.size
}