/**
 * A geologist wants to calculate the volume of water in each rock sample
 * by subtracting the weight of the dry rock from the weight of the wet rock.
 *
 * Complete the function below to calculate the volume of water in each rock sample.
 *
 * @param rockSamples a list of rock samples, represented as their weights in grams
 * @param waterSamples a list of water samples, represented as their weights in grams
 * @return a list containing the volume of water in each rock sample
 *
 * Difficulty: Difficult
 */
fun calculateVolumeOfWater(rockSamples: List<Double>, waterSamples: List<Double>): List<Double> {

    // Creating an empty list to store the volumes of water
    val volumeOfWater = mutableListOf<Double>()
    
    // Iterating over each rock sample and corresponding water sample
    for ((rock, water) in rockSamples.zip(waterSamples)) {
        // Subtracting the weight of dry rock from the weight of wet rock
        val volume = rock - water
        
        // Appending the calculated volume to the list
        volumeOfWater.add(volume)
    }
    
    return volumeOfWater
}
/**
 * A geologist wants to calculate the volume of water in each rock sample
 * by subtracting the weight of the dry rock from the weight of the wet rock.
 *
 * Complete the function below to calculate the volume of water in each rock sample.
 *
 * @param rockSamples a list of rock samples, represented as their weights in grams
 * @param waterSamples a list of water samples, represented as their weights in grams
 * @return a list containing the volume of water in each rock sample
 *
 * Difficulty: Difficult
 */
fun calculateVolumeOfWater(rockSamples: List<Double>, waterSamples: List<Double>): List<Double> {
/**
 * A geologist wants to calculate the volume of water in each rock sample
 * by subtracting the weight of the dry rock from the weight of the wet rock.
 *
 * Complete the function below to calculate the volume of water in each rock sample.
 *
 * @param rockSamples a list of rock samples, represented as their weights in grams
 * @param waterSamples a list of water samples, represented as their weights in grams
 * @return a list containing the volume of water in each rock sample
 *
 * Difficulty: Difficult
 */
fun calculateVolumeOfWater(rockSamples: List<Double>, waterSamples: List<Double>): List<Double> {

    // Creating an empty list to store the volumes of water
    val volumeOfWater = mutableListOf<Double>()
    
    // Iterating over each rock sample and corresponding water sample
    for ((rock, water) in rockSamples.zip(waterSamples)) {
        // Subtracting the weight of dry rock from the weight of wet rock
        val volume = rock - water
        
        // Appending the calculated volume to the list
        volumeOfWater.add(volume)
    }
    
    return volumeOfWater
}