/**
 * This function takes in two lists of patients and returns the common patients between them.
 * The function uses the 'in' statement along with 'Boolean operations' to find the intersection.
 */
fun findCommonPatients(patientList1: List<String>, patientList2: List<String>): List<String> {

    // Initialize an empty list to store common patients
    val commonPatients = mutableListOf<String>()

    // Loop through each patient in the first list
    for (patient in patientList1) {
        // Check if the patient is also present in the second list
        if (patient in patientList2 && patient !in commonPatients) {
            // Add the patient to the commonPatients list
            commonPatients.add(patient)
        }
    }

    // Return the list of common patients
    return commonPatients
}
/**
 * This function takes in two lists of patients and returns the common patients between them.
 * The function uses the 'in' statement along with 'Boolean operations' to find the intersection.
 */
fun findCommonPatients(patientList1: List<String>, patientList2: List<String>): List<String> {
/**
 * This function takes in two lists of patients and returns the common patients between them.
 * The function uses the 'in' statement along with 'Boolean operations' to find the intersection.
 */
fun findCommonPatients(patientList1: List<String>, patientList2: List<String>): List<String> {

    // Initialize an empty list to store common patients
    val commonPatients = mutableListOf<String>()

    // Loop through each patient in the first list
    for (patient in patientList1) {
        // Check if the patient is also present in the second list
        if (patient in patientList2 && patient !in commonPatients) {
            // Add the patient to the commonPatients list
            commonPatients.add(patient)
        }
    }

    // Return the list of common patients
    return commonPatients
}