/**
 * As a geologist, you are given a list of minerals and their densities.
 * Your task is to create a dictionary that includes only the minerals with densities
 * less than 2.5 g/cm³. The keys of the dictionary should be the minerals' names,
 * and the values should be their corresponding densities.
 *
 * @param minerals A list of pairs where each pair contains the name of a mineral
 *                 and its density in g/cm³.
 * @return A map containing the minerals with densities less than 2.5 g/cm³.
 *
 * Note: Make sure to consider minerals with densities less than 2.5 but not equal to it.
 */
fun checkMineralDensity(minerals: List<Pair<String, Double>>): Map<String, Double> {

    val mineralDensities = mutableMapOf<String, Double>()

    for (mineral in minerals) {
        val (name, density) = mineral

        if (density < 2.5) {
            // Add the mineral and its density to the map
            mineralDensities[name] = density
        }
    }

    return mineralDensities
}
/**
 * As a geologist, you are given a list of minerals and their densities.
 * Your task is to create a dictionary that includes only the minerals with densities
 * less than 2.5 g/cm³. The keys of the dictionary should be the minerals' names,
 * and the values should be their corresponding densities.
 *
 * @param minerals A list of pairs where each pair contains the name of a mineral
 *                 and its density in g/cm³.
 * @return A map containing the minerals with densities less than 2.5 g/cm³.
 *
 * Note: Make sure to consider minerals with densities less than 2.5 but not equal to it.
 */
fun checkMineralDensity(minerals: List<Pair<String, Double>>): Map<String, Double> {
/**
 * As a geologist, you are given a list of minerals and their densities.
 * Your task is to create a dictionary that includes only the minerals with densities
 * less than 2.5 g/cm³. The keys of the dictionary should be the minerals' names,
 * and the values should be their corresponding densities.
 *
 * @param minerals A list of pairs where each pair contains the name of a mineral
 *                 and its density in g/cm³.
 * @return A map containing the minerals with densities less than 2.5 g/cm³.
 *
 * Note: Make sure to consider minerals with densities less than 2.5 but not equal to it.
 */
fun checkMineralDensity(minerals: List<Pair<String, Double>>): Map<String, Double> {

    val mineralDensities = mutableMapOf<String, Double>()

    for (mineral in minerals) {
        val (name, density) = mineral

        if (density < 2.5) {
            // Add the mineral and its density to the map
            mineralDensities[name] = density
        }
    }

    return mineralDensities
}