/**
 * This function takes a list of patients and their visit counts, and returns a list of patients who have visited the hospital an odd number of times.
 * @param patients A list of patient names.
 * @param visitCounts A map where the keys are patient names and the values are the number of times they have visited the hospital.
 * @return A list of patients who visited the hospital an odd number of times.
 */
fun findPatientWithOddNumberOfVisits(patients: List<String>, visitCounts: Map<String, Int>): List<String> {

    val oddVisitPatients = mutableListOf<String>()

    for (patient in patients) {
        if (visitCounts.getOrDefault(patient, 0) % 2 != 0) { // Checking if the visit count of a patient is not divisible by 2 (i.e., odd).
            oddVisitPatients.add(patient)
        }
    }

    return oddVisitPatients
}
/**
 * This function takes a list of patients and their visit counts, and returns a list of patients who have visited the hospital an odd number of times.
 * @param patients A list of patient names.
 * @param visitCounts A map where the keys are patient names and the values are the number of times they have visited the hospital.
 * @return A list of patients who visited the hospital an odd number of times.
 */
fun findPatientWithOddNumberOfVisits(patients: List<String>, visitCounts: Map<String, Int>): List<String> {
/**
 * This function takes a list of patients and their visit counts, and returns a list of patients who have visited the hospital an odd number of times.
 * @param patients A list of patient names.
 * @param visitCounts A map where the keys are patient names and the values are the number of times they have visited the hospital.
 * @return A list of patients who visited the hospital an odd number of times.
 */
fun findPatientWithOddNumberOfVisits(patients: List<String>, visitCounts: Map<String, Int>): List<String> {

    val oddVisitPatients = mutableListOf<String>()

    for (patient in patients) {
        if (visitCounts.getOrDefault(patient, 0) % 2 != 0) { // Checking if the visit count of a patient is not divisible by 2 (i.e., odd).
            oddVisitPatients.add(patient)
        }
    }

    return oddVisitPatients
}