/**
 * Calculate the total fuel consumption for each aircraft based on the given flight data.
 *
 * Flight data is a nested dictionary containing the aircraft name as the key, and another dictionary as the value.
 * The inner dictionary contains the segments flown represented by numbers as keys, and the fuel consumption for each segment as the value.
 *
 * The fuel consumption is given in gallons per hour. We need to calculate the total fuel consumption for each aircraft by summing up the fuel consumption for all segments.
 *
 * @param flightData Nested dictionary containing the flight data.
 * @return A dictionary with aircraft names as keys and the total fuel consumption as values.
 */
fun calculateFuelConsumption(flightData: Map<String, Map<Int, Int>>): Map<String, Int> {

    val totalFuelConsumption = mutableMapOf<String, Int>()

    for ((aircraft, segmentData) in flightData) {
        var totalFuel = 0
        for ((_, fuelConsumption) in segmentData) {
            totalFuel += fuelConsumption
        }
        totalFuelConsumption[aircraft] = totalFuel
    }

    return totalFuelConsumption
}
/**
 * Calculate the total fuel consumption for each aircraft based on the given flight data.
 *
 * Flight data is a nested dictionary containing the aircraft name as the key, and another dictionary as the value.
 * The inner dictionary contains the segments flown represented by numbers as keys, and the fuel consumption for each segment as the value.
 *
 * The fuel consumption is given in gallons per hour. We need to calculate the total fuel consumption for each aircraft by summing up the fuel consumption for all segments.
 *
 * @param flightData Nested dictionary containing the flight data.
 * @return A dictionary with aircraft names as keys and the total fuel consumption as values.
 */
fun calculateFuelConsumption(flightData: Map<String, Map<Int, Int>>): Map<String, Int> {
/**
 * Calculate the total fuel consumption for each aircraft based on the given flight data.
 *
 * Flight data is a nested dictionary containing the aircraft name as the key, and another dictionary as the value.
 * The inner dictionary contains the segments flown represented by numbers as keys, and the fuel consumption for each segment as the value.
 *
 * The fuel consumption is given in gallons per hour. We need to calculate the total fuel consumption for each aircraft by summing up the fuel consumption for all segments.
 *
 * @param flightData Nested dictionary containing the flight data.
 * @return A dictionary with aircraft names as keys and the total fuel consumption as values.
 */
fun calculateFuelConsumption(flightData: Map<String, Map<Int, Int>>): Map<String, Int> {

    val totalFuelConsumption = mutableMapOf<String, Int>()

    for ((aircraft, segmentData) in flightData) {
        var totalFuel = 0
        for ((_, fuelConsumption) in segmentData) {
            totalFuel += fuelConsumption
        }
        totalFuelConsumption[aircraft] = totalFuel
    }

    return totalFuelConsumption
}