/**
 * Given two lists of porosity values representing different soil samples, this function checks if there is any
 * intersection between the two sets of porosity values.
 *
 * @param list1 List of porosity values for the first soil sample.
 * @param list2 List of porosity values for the second soil sample.
 * @return Set of porosity values that are present in both soil samples.
 *
 * Example:
 * checkIntersectingPorosity(listOf(0.2, 0.3, 0.4, 0.5), listOf(0.4, 0.5, 0.6, 0.7)) -> [0.4, 0.5]
 */
fun checkIntersectingPorosity(list1: List<Double>, list2: List<Double>): Set<Double> {

    val intersectingPorosity = mutableSetOf<Double>()

    for (val1 in list1) {
        for (val2 in list2) {
            if (val1 == val2) {
                intersectingPorosity.add(val1)
            }
        }
    }

    return intersectingPorosity
}
/**
 * Given two lists of porosity values representing different soil samples, this function checks if there is any
 * intersection between the two sets of porosity values.
 *
 * @param list1 List of porosity values for the first soil sample.
 * @param list2 List of porosity values for the second soil sample.
 * @return Set of porosity values that are present in both soil samples.
 *
 * Example:
 * checkIntersectingPorosity(listOf(0.2, 0.3, 0.4, 0.5), listOf(0.4, 0.5, 0.6, 0.7)) -> [0.4, 0.5]
 */
fun checkIntersectingPorosity(list1: List<Double>, list2: List<Double>): Set<Double> {
/**
 * Given two lists of porosity values representing different soil samples, this function checks if there is any
 * intersection between the two sets of porosity values.
 *
 * @param list1 List of porosity values for the first soil sample.
 * @param list2 List of porosity values for the second soil sample.
 * @return Set of porosity values that are present in both soil samples.
 *
 * Example:
 * checkIntersectingPorosity(listOf(0.2, 0.3, 0.4, 0.5), listOf(0.4, 0.5, 0.6, 0.7)) -> [0.4, 0.5]
 */
fun checkIntersectingPorosity(list1: List<Double>, list2: List<Double>): Set<Double> {

    val intersectingPorosity = mutableSetOf<Double>()

    for (val1 in list1) {
        for (val2 in list2) {
            if (val1 == val2) {
                intersectingPorosity.add(val1)
            }
        }
    }

    return intersectingPorosity
}