/**
 * Given a map of patient records and a set of priority patients,
 * return a list of names for the patients who are both in the map and the priority set.
 */
fun getPatientNames(patientRecords: Map<String, Map<String, String>>, priorityPatients: Set<String>): List<String> {

    // Use map values and filter to check if a patient is both in the map and the set
    val patientNames = patientRecords.values
        .filter { it["name"] in priorityPatients }
        .map { it["name"] ?: "" }

    return patientNames
}
/**
 * Given a map of patient records and a set of priority patients,
 * return a list of names for the patients who are both in the map and the priority set.
 */
fun getPatientNames(patientRecords: Map<String, Map<String, String>>, priorityPatients: Set<String>): List<String> {
/**
 * Given a map of patient records and a set of priority patients,
 * return a list of names for the patients who are both in the map and the priority set.
 */
fun getPatientNames(patientRecords: Map<String, Map<String, String>>, priorityPatients: Set<String>): List<String> {

    // Use map values and filter to check if a patient is both in the map and the set
    val patientNames = patientRecords.values
        .filter { it["name"] in priorityPatients }
        .map { it["name"] ?: "" }

    return patientNames
}