/**
 * This function takes a list of photographs and returns a filtered list that meets
 * the specified quality threshold. The quality threshold should be passed as a parameter.
 *
 * @param photographs A list of photographs.
 * @param qualityThreshold The minimum quality threshold for filtering the photographs.
 * @return A filtered list of photographs that meet the quality threshold.
 */
fun filterPhotographs(photographs: List<Map<String, Any>>, qualityThreshold: Int): List<Map<String, Any>> {

    // Initialize an empty list to store the filtered photographs
    val filteredPhotographs = mutableListOf<Map<String, Any>>()

    // Iterate over each photograph in the input list
    for (photograph in photographs) {
        // Check if the photograph meets the quality threshold
        val meetsThreshold = photograph["quality"] as Int >= qualityThreshold

        // Check if the photograph meets both the quality threshold and the type criteria
        if (meetsThreshold && photograph["type"] in listOf("portrait", "landscape")) {
            // Create a shallow copy of the photograph and append it to the filtered list
            val copiedPhotograph = HashMap(photograph)
            filteredPhotographs.add(copiedPhotograph)
        }
    }

    return filteredPhotographs
}
/**
 * This function takes a list of photographs and returns a filtered list that meets
 * the specified quality threshold. The quality threshold should be passed as a parameter.
 *
 * @param photographs A list of photographs.
 * @param qualityThreshold The minimum quality threshold for filtering the photographs.
 * @return A filtered list of photographs that meet the quality threshold.
 */
fun filterPhotographs(photographs: List<Map<String, Any>>, qualityThreshold: Int): List<Map<String, Any>> {
/**
 * This function takes a list of photographs and returns a filtered list that meets
 * the specified quality threshold. The quality threshold should be passed as a parameter.
 *
 * @param photographs A list of photographs.
 * @param qualityThreshold The minimum quality threshold for filtering the photographs.
 * @return A filtered list of photographs that meet the quality threshold.
 */
fun filterPhotographs(photographs: List<Map<String, Any>>, qualityThreshold: Int): List<Map<String, Any>> {

    // Initialize an empty list to store the filtered photographs
    val filteredPhotographs = mutableListOf<Map<String, Any>>()

    // Iterate over each photograph in the input list
    for (photograph in photographs) {
        // Check if the photograph meets the quality threshold
        val meetsThreshold = photograph["quality"] as Int >= qualityThreshold

        // Check if the photograph meets both the quality threshold and the type criteria
        if (meetsThreshold && photograph["type"] in listOf("portrait", "landscape")) {
            // Create a shallow copy of the photograph and append it to the filtered list
            val copiedPhotograph = HashMap(photograph)
            filteredPhotographs.add(copiedPhotograph)
        }
    }

    return filteredPhotographs
}