/**
 * Given a set of patient data and a condition, this function filters out the patients who meet the condition.
 *
 * @param patientData Set containing tuples of patient data in the format (patientId, age, condition).
 * @param condition A function that takes a patient's age as argument and returns true if the patient meets the condition, false otherwise.
 * @return Set containing tuples of patient data for patients who meet the condition.
 */
fun filterPatients(patientData: Set<Triple<Int, Int, String>>, condition: (Int) -> Boolean): Set<Triple<Int, Int, String>> {

    val filteredPatients = mutableSetOf<Triple<Int, Int, String>>()

    for (patient in patientData) {
        val patientAge = patient.second
        if (condition(patientAge)) {
            filteredPatients.add(patient)
        }
    }

    return filteredPatients
}
/**
 * Given a set of patient data and a condition, this function filters out the patients who meet the condition.
 *
 * @param patientData Set containing tuples of patient data in the format (patientId, age, condition).
 * @param condition A function that takes a patient's age as argument and returns true if the patient meets the condition, false otherwise.
 * @return Set containing tuples of patient data for patients who meet the condition.
 */
fun filterPatients(patientData: Set<Triple<Int, Int, String>>, condition: (Int) -> Boolean): Set<Triple<Int, Int, String>> {
/**
 * Given a set of patient data and a condition, this function filters out the patients who meet the condition.
 *
 * @param patientData Set containing tuples of patient data in the format (patientId, age, condition).
 * @param condition A function that takes a patient's age as argument and returns true if the patient meets the condition, false otherwise.
 * @return Set containing tuples of patient data for patients who meet the condition.
 */
fun filterPatients(patientData: Set<Triple<Int, Int, String>>, condition: (Int) -> Boolean): Set<Triple<Int, Int, String>> {

    val filteredPatients = mutableSetOf<Triple<Int, Int, String>>()

    for (patient in patientData) {
        val patientAge = patient.second
        if (condition(patientAge)) {
            filteredPatients.add(patient)
        }
    }

    return filteredPatients
}