/**
 * Your task is to iterate over a dictionary named 'dictionary' which contains information of patients treated by a physician.
 * Within the loop, you need to check if there are any patients whose medical condition is critical. If you find a critical patient,
 * you should immediately break out of the loop and print 'Critical patient found'. Otherwise, you should continue iterating
 * over the dictionary and print the patient's name along with their age.
 *
 * @param dictionary A dictionary containing patient information where the key is the patient's name and the value is their age.
 */
fun loopDictionary(dictionary: Map<String, Int>) {

    for ((patient, age) in dictionary) {
        // Write your code here to check if patient's medical condition is critical
        if (patient.contains("critical", ignoreCase = true)) {
            println("Critical patient found")
            // Complete the code to break out of the loop
            break
        }
        // Write your code here to print patient's name along with their age
        println("Patient: $patient, Age: $age")
    }
    // Add the final line of code to print 'Loop completed' once the loop is finished
    println("Loop completed")
}
/**
 * Your task is to iterate over a dictionary named 'dictionary' which contains information of patients treated by a physician.
 * Within the loop, you need to check if there are any patients whose medical condition is critical. If you find a critical patient,
 * you should immediately break out of the loop and print 'Critical patient found'. Otherwise, you should continue iterating
 * over the dictionary and print the patient's name along with their age.
 *
 * @param dictionary A dictionary containing patient information where the key is the patient's name and the value is their age.
 */
fun loopDictionary(dictionary: Map<String, Int>) {
/**
 * Your task is to iterate over a dictionary named 'dictionary' which contains information of patients treated by a physician.
 * Within the loop, you need to check if there are any patients whose medical condition is critical. If you find a critical patient,
 * you should immediately break out of the loop and print 'Critical patient found'. Otherwise, you should continue iterating
 * over the dictionary and print the patient's name along with their age.
 *
 * @param dictionary A dictionary containing patient information where the key is the patient's name and the value is their age.
 */
fun loopDictionary(dictionary: Map<String, Int>) {

    for ((patient, age) in dictionary) {
        // Write your code here to check if patient's medical condition is critical
        if (patient.contains("critical", ignoreCase = true)) {
            println("Critical patient found")
            // Complete the code to break out of the loop
            break
        }
        // Write your code here to print patient's name along with their age
        println("Patient: $patient, Age: $age")
    }
    // Add the final line of code to print 'Loop completed' once the loop is finished
    println("Loop completed")
}