/**
 * This function takes a list of patients and a list of conditions and returns a new list of patients who have at least
 * one condition from the given list.
 *
 * @param patients A list of patient names.
 * @param conditions A list of condition names.
 * @return A list of patients who have at least one condition from the given list.
 *
 * Example:
 * patients = ['John', 'Alice', 'Michael', 'Linda', 'David']
 * conditions = ['diabetes', 'hypertension', 'asthma']
 * filterPatients(patients, conditions) // Output: ['John', 'Alice']
 *
 * Note:
 * The function uses list comprehension and the OR operator ('or') to check if any of the conditions in the given
 * list are in the patient's condition list.
 */
fun filterPatients(patients: List<String>, conditions: List<String>): List<String> {

    return patients.filter { patient -> conditions.any { condition -> patient.contains(condition) } }
}
/**
 * This function takes a list of patients and a list of conditions and returns a new list of patients who have at least
 * one condition from the given list.
 *
 * @param patients A list of patient names.
 * @param conditions A list of condition names.
 * @return A list of patients who have at least one condition from the given list.
 *
 * Example:
 * patients = ['John', 'Alice', 'Michael', 'Linda', 'David']
 * conditions = ['diabetes', 'hypertension', 'asthma']
 * filterPatients(patients, conditions) // Output: ['John', 'Alice']
 *
 * Note:
 * The function uses list comprehension and the OR operator ('or') to check if any of the conditions in the given
 * list are in the patient's condition list.
 */
fun filterPatients(patients: List<String>, conditions: List<String>): List<String> {
/**
 * This function takes a list of patients and a list of conditions and returns a new list of patients who have at least
 * one condition from the given list.
 *
 * @param patients A list of patient names.
 * @param conditions A list of condition names.
 * @return A list of patients who have at least one condition from the given list.
 *
 * Example:
 * patients = ['John', 'Alice', 'Michael', 'Linda', 'David']
 * conditions = ['diabetes', 'hypertension', 'asthma']
 * filterPatients(patients, conditions) // Output: ['John', 'Alice']
 *
 * Note:
 * The function uses list comprehension and the OR operator ('or') to check if any of the conditions in the given
 * list are in the patient's condition list.
 */
fun filterPatients(patients: List<String>, conditions: List<String>): List<String> {

    return patients.filter { patient -> conditions.any { condition -> patient.contains(condition) } }
}