/**
 * Given a list of geographic features, iterate over each feature
 * and return a new list containing only the features that meet 
 * certain criteria.
 *
 * @param data A list of geographic features
 * @param value The maximum value allowed for the geographic feature
 * @return A new list containing only the features that meet the criteria
 *
 * Example:
 * val data = listOf(Pair("Mountain", 3500), Pair("Lake", 500), Pair("River", 200), Pair("Forest", 1000))
 * loopSliceIntersection(data, 1000)
 * Output: [(Mountain, 3500), (Forest, 1000)]
 */
fun loopSliceIntersection(data: List<Pair<String, Int>>, value: Int): List<Pair<String, Int>> {

    val selectedFeatures = mutableListOf<Pair<String, Int>>()

    for (feature in data) {
        if (feature.second <= value) {
            selectedFeatures.add(feature)
        }
    }

    return selectedFeatures
}
/**
 * Given a list of geographic features, iterate over each feature
 * and return a new list containing only the features that meet 
 * certain criteria.
 *
 * @param data A list of geographic features
 * @param value The maximum value allowed for the geographic feature
 * @return A new list containing only the features that meet the criteria
 *
 * Example:
 * val data = listOf(Pair("Mountain", 3500), Pair("Lake", 500), Pair("River", 200), Pair("Forest", 1000))
 * loopSliceIntersection(data, 1000)
 * Output: [(Mountain, 3500), (Forest, 1000)]
 */
fun loopSliceIntersection(data: List<Pair<String, Int>>, value: Int): List<Pair<String, Int>> {
/**
 * Given a list of geographic features, iterate over each feature
 * and return a new list containing only the features that meet 
 * certain criteria.
 *
 * @param data A list of geographic features
 * @param value The maximum value allowed for the geographic feature
 * @return A new list containing only the features that meet the criteria
 *
 * Example:
 * val data = listOf(Pair("Mountain", 3500), Pair("Lake", 500), Pair("River", 200), Pair("Forest", 1000))
 * loopSliceIntersection(data, 1000)
 * Output: [(Mountain, 3500), (Forest, 1000)]
 */
fun loopSliceIntersection(data: List<Pair<String, Int>>, value: Int): List<Pair<String, Int>> {

    val selectedFeatures = mutableListOf<Pair<String, Int>>()

    for (feature in data) {
        if (feature.second <= value) {
            selectedFeatures.add(feature)
        }
    }

    return selectedFeatures
}