/**
 * This function takes a population data map as input and calculates the population density for each location.
 * The population data map contains the number of people in each location.
 * The function returns a new map with the location and its calculated population density.
 *
 * @param populationData A map containing the number of people in each location.
 * @return A map with the location and its calculated population density.
 *
 * Example:
 * calculatePopulationDensity(mapOf("City A" to 10000, "City B" to 5000, "City C" to 7500))
 * Output: mapOf("City A" to "High", "City B" to "Medium", "City C" to "Low")
 */
fun calculatePopulationDensity(populationData: Map<String, Int>): Map<String, String> {

    val populationDensity = mutableMapOf<String, String>()

    for ((location, population) in populationData) {
        populationDensity[location] = when {
            population >= 10000 -> "High"
            population >= 5000 -> "Medium"
            else -> "Low"
        }
    }

    return populationDensity
}
/**
 * This function takes a population data map as input and calculates the population density for each location.
 * The population data map contains the number of people in each location.
 * The function returns a new map with the location and its calculated population density.
 *
 * @param populationData A map containing the number of people in each location.
 * @return A map with the location and its calculated population density.
 *
 * Example:
 * calculatePopulationDensity(mapOf("City A" to 10000, "City B" to 5000, "City C" to 7500))
 * Output: mapOf("City A" to "High", "City B" to "Medium", "City C" to "Low")
 */
fun calculatePopulationDensity(populationData: Map<String, Int>): Map<String, String> {
/**
 * This function takes a population data map as input and calculates the population density for each location.
 * The population data map contains the number of people in each location.
 * The function returns a new map with the location and its calculated population density.
 *
 * @param populationData A map containing the number of people in each location.
 * @return A map with the location and its calculated population density.
 *
 * Example:
 * calculatePopulationDensity(mapOf("City A" to 10000, "City B" to 5000, "City C" to 7500))
 * Output: mapOf("City A" to "High", "City B" to "Medium", "City C" to "Low")
 */
fun calculatePopulationDensity(populationData: Map<String, Int>): Map<String, String> {

    val populationDensity = mutableMapOf<String, String>()

    for ((location, population) in populationData) {
        populationDensity[location] = when {
            population >= 10000 -> "High"
            population >= 5000 -> "Medium"
            else -> "Low"
        }
    }

    return populationDensity
}