/**
 * This function takes a nested list of patients and their conditions,
 * and returns a list of patients who have the specified condition.
 *
 * @param patients nested list of patients and their conditions
 * @param condition the condition to search for
 * @return a list of patients who have the specified condition
 */
fun findPatientsWithCondition(patients: List<List<String>>, condition: String): List<List<String>> {

    val patientsWithCondition = mutableListOf<List<String>>()

    for (patient in patients) {
        for (i in patient.indices) {
            if (patient[i] == condition) {
                patientsWithCondition.add(patient)
                break
            }
        }
    }

    return patientsWithCondition
}

// Example usage
/**
 * This function takes a nested list of patients and their conditions,
 * and returns a list of patients who have the specified condition.
 *
 * @param patients nested list of patients and their conditions
 * @param condition the condition to search for
 * @return a list of patients who have the specified condition
 */
fun findPatientsWithCondition(patients: List<List<String>>, condition: String): List<List<String>> {
/**
 * This function takes a nested list of patients and their conditions,
 * and returns a list of patients who have the specified condition.
 *
 * @param patients nested list of patients and their conditions
 * @param condition the condition to search for
 * @return a list of patients who have the specified condition
 */
fun findPatientsWithCondition(patients: List<List<String>>, condition: String): List<List<String>> {

    val patientsWithCondition = mutableListOf<List<String>>()

    for (patient in patients) {
        for (i in patient.indices) {
            if (patient[i] == condition) {
                patientsWithCondition.add(patient)
                break
            }
        }
    }

    return patientsWithCondition
}

// Example usage