/**
 * Given a nested dictionary 'temperatureData' containing temperature records for different days and locations,
 * write a function that merges the records for each location into a single list of tuples.
 *
 * @param temperatureData A nested dictionary containing temperature records.
 *                        The keys of the outer dictionary are the location names,
 *                        and the values are dictionaries containing temperature records for each day.
 *                        Each inner dictionary has the keys as dates and the values as temperatures.
 * @return A dictionary where keys are the location names and values are lists of tuples,
 *         where each tuple contains the date and temperature for that location.
 */
fun mergeTemperatureData(temperatureData: Map<String, Map<String, Int>>): Map<String, List<Pair<String, Int>>> {

    val mergedData = mutableMapOf<String, List<Pair<String, Int>>>()
    for ((location, records) in temperatureData) {
        mergedData[location] = records.map { (date, temperature) -> date to temperature }
    }
    return mergedData
}
/**
 * Given a nested dictionary 'temperatureData' containing temperature records for different days and locations,
 * write a function that merges the records for each location into a single list of tuples.
 *
 * @param temperatureData A nested dictionary containing temperature records.
 *                        The keys of the outer dictionary are the location names,
 *                        and the values are dictionaries containing temperature records for each day.
 *                        Each inner dictionary has the keys as dates and the values as temperatures.
 * @return A dictionary where keys are the location names and values are lists of tuples,
 *         where each tuple contains the date and temperature for that location.
 */
fun mergeTemperatureData(temperatureData: Map<String, Map<String, Int>>): Map<String, List<Pair<String, Int>>> {
/**
 * Given a nested dictionary 'temperatureData' containing temperature records for different days and locations,
 * write a function that merges the records for each location into a single list of tuples.
 *
 * @param temperatureData A nested dictionary containing temperature records.
 *                        The keys of the outer dictionary are the location names,
 *                        and the values are dictionaries containing temperature records for each day.
 *                        Each inner dictionary has the keys as dates and the values as temperatures.
 * @return A dictionary where keys are the location names and values are lists of tuples,
 *         where each tuple contains the date and temperature for that location.
 */
fun mergeTemperatureData(temperatureData: Map<String, Map<String, Int>>): Map<String, List<Pair<String, Int>>> {

    val mergedData = mutableMapOf<String, List<Pair<String, Int>>>()
    for ((location, records) in temperatureData) {
        mergedData[location] = records.map { (date, temperature) -> date to temperature }
    }
    return mergedData
}