/**
 * Given a dictionary of patient records (patientRecords) and the name of a patient (patientName),
 * find the list of medications prescribed to that patient and return it.
 *
 * If the patient name is not found in the dictionary, return an empty list.
 */
fun getMedication(patientRecords: Map<String, Map<String, List<String>>>, patientName: String): List<String> {

    for ((patient, record) in patientRecords) {
        if (patient == patientName) {
            return record["medications"] ?: emptyList()
        }
    }
    return emptyList()
}
/**
 * Given a dictionary of patient records (patientRecords) and the name of a patient (patientName),
 * find the list of medications prescribed to that patient and return it.
 *
 * If the patient name is not found in the dictionary, return an empty list.
 */
fun getMedication(patientRecords: Map<String, Map<String, List<String>>>, patientName: String): List<String> {
/**
 * Given a dictionary of patient records (patientRecords) and the name of a patient (patientName),
 * find the list of medications prescribed to that patient and return it.
 *
 * If the patient name is not found in the dictionary, return an empty list.
 */
fun getMedication(patientRecords: Map<String, Map<String, List<String>>>, patientName: String): List<String> {

    for ((patient, record) in patientRecords) {
        if (patient == patientName) {
            return record["medications"] ?: emptyList()
        }
    }
    return emptyList()
}