/**
 * This function takes a list of patients and returns the names of patients who have a specified condition.
 * The conditions are stored in a dictionary where the keys represent the conditions and the values represent the patients with those conditions.
 */
fun selectPatients(patientList: List<String>) {

    val conditionDict = mapOf(
        "Fever" to listOf("John", "Megan", "Sarah"),
        "Cough" to listOf("Tom", "Emily", "Daniel"),
        "Headache" to listOf("Chris", "Olivia", "Emma"),
        "Sore Throat" to listOf("Liam", "Sophia", "Ava")
    )

    // Prompt the nurse to input a condition
    print("Enter a condition: ")
    val condition = readLine()

    // Use a list method to check if the condition is in the dictionary keys
    if (condition in conditionDict.keys) {
        // Use a dictionary method to access the list of patients with the specified condition
        val patientsWithCondition = conditionDict[condition]
    } else {
        println("Invalid condition!")
    }

    // Prompt the nurse to input the maximum required patients
    print("Enter the maximum number of patients required: ")
    val maxPatients = readLine()?.toIntOrNull()

    // Use list slicing to select the specified number of patients
}
/**
 * This function takes a list of patients and returns the names of patients who have a specified condition.
 * The conditions are stored in a dictionary where the keys represent the conditions and the values represent the patients with those conditions.
 */
fun selectPatients(patientList: List<String>) {
/**
 * This function takes a list of patients and returns the names of patients who have a specified condition.
 * The conditions are stored in a dictionary where the keys represent the conditions and the values represent the patients with those conditions.
 */
fun selectPatients(patientList: List<String>) {

    val conditionDict = mapOf(
        "Fever" to listOf("John", "Megan", "Sarah"),
        "Cough" to listOf("Tom", "Emily", "Daniel"),
        "Headache" to listOf("Chris", "Olivia", "Emma"),
        "Sore Throat" to listOf("Liam", "Sophia", "Ava")
    )

    // Prompt the nurse to input a condition
    print("Enter a condition: ")
    val condition = readLine()

    // Use a list method to check if the condition is in the dictionary keys
    if (condition in conditionDict.keys) {
        // Use a dictionary method to access the list of patients with the specified condition
        val patientsWithCondition = conditionDict[condition]
    } else {
        println("Invalid condition!")
    }

    // Prompt the nurse to input the maximum required patients
    print("Enter the maximum number of patients required: ")
    val maxPatients = readLine()?.toIntOrNull()

    // Use list slicing to select the specified number of patients
}