/**
 * This exercise requires you to iterate over a dictionary of accounts
 * and calculate the sum of the values of each account.
 *
 * Complete the code below to solve the exercise:
 */
fun printAccountSum(accounts: Map<String, List<Map<String, Int>>>) {

    // Initialize a variable to keep track of the total sum
    var totalSum = 0

    // Iterate over the dictionary of accounts
    for ((_, transactions) in accounts) {
        // Iterate over the list of transactions for each account
        for (transaction in transactions) {
            // Add the value of each transaction to the total sum
            totalSum += transaction["value"] ?: 0
        }
    }

    // Print the final sum of all accounts
    println("The total sum of all accounts is: $totalSum")
}
/**
 * This exercise requires you to iterate over a dictionary of accounts
 * and calculate the sum of the values of each account.
 *
 * Complete the code below to solve the exercise:
 */
fun printAccountSum(accounts: Map<String, List<Map<String, Int>>>) {
/**
 * This exercise requires you to iterate over a dictionary of accounts
 * and calculate the sum of the values of each account.
 *
 * Complete the code below to solve the exercise:
 */
fun printAccountSum(accounts: Map<String, List<Map<String, Int>>>) {

    // Initialize a variable to keep track of the total sum
    var totalSum = 0

    // Iterate over the dictionary of accounts
    for ((_, transactions) in accounts) {
        // Iterate over the list of transactions for each account
        for (transaction in transactions) {
            // Add the value of each transaction to the total sum
            totalSum += transaction["value"] ?: 0
        }
    }

    // Print the final sum of all accounts
    println("The total sum of all accounts is: $totalSum")
}