/**
 * This exercise aims to calculate the average scores of students
 * based on the data provided in a nested dictionary. Each student has multiple categories
 * with respective integer scores. Your task is to calculate the average
 * score for each student and return a dictionary with their names as keys
 * and average scores as values.
 */
fun getAverageScores(data: Map<String, Map<String, Int>>): Map<String, Double> {

    val averageScores = mutableMapOf<String, Double>()

    for ((student, categories) in data) {
        var totalScore = 0
        var numCategories = 0

        for (score in categories.values) {
            totalScore += score
            numCategories++
        }

        averageScores[student] = totalScore.toDouble() / numCategories
    }

    return averageScores
}

// Example usage
/**
 * This exercise aims to calculate the average scores of students
 * based on the data provided in a nested dictionary. Each student has multiple categories
 * with respective integer scores. Your task is to calculate the average
 * score for each student and return a dictionary with their names as keys
 * and average scores as values.
 */
fun getAverageScores(data: Map<String, Map<String, Int>>): Map<String, Double> {
/**
 * This exercise aims to calculate the average scores of students
 * based on the data provided in a nested dictionary. Each student has multiple categories
 * with respective integer scores. Your task is to calculate the average
 * score for each student and return a dictionary with their names as keys
 * and average scores as values.
 */
fun getAverageScores(data: Map<String, Map<String, Int>>): Map<String, Double> {

    val averageScores = mutableMapOf<String, Double>()

    for ((student, categories) in data) {
        var totalScore = 0
        var numCategories = 0

        for (score in categories.values) {
            totalScore += score
            numCategories++
        }

        averageScores[student] = totalScore.toDouble() / numCategories
    }

    return averageScores
}

// Example usage