/**
 * In this exercise, you are given a dictionary named 'emotionsDict' which contains emotions as keys and their corresponding intensities as values. Your task is to loop through the dictionary and find the emotion with the highest intensity.
 *
 * To solve this exercise, you can make use of a built-in function that retrieves the maximum value from a sequence.
 *
 * Your goal is to complete the code to find the emotion with the highest intensity and return it.
 *
 * Example:
 * val emotionsDict = mapOf("Anger" to 9, "Happiness" to 6, "Sadness" to 8, "Fear" to 7)
 * analyzeEmotions(emotionsDict)
 *
 * Expected Output:
 * The emotion with the highest intensity is Anger.
 *
 * Note:
 * The code should be able to handle any dictionary with emotions and intensities.
 */
fun analyzeEmotions(emotionsDict: Map<String, Int>): String {

    val maxIntensity = emotionsDict.values.maxOrNull() ?: return "No emotion found."

    for ((emotion, intensity) in emotionsDict) {
        if (intensity == maxIntensity) {
            return "The emotion with the highest intensity is $emotion."
        }
    }

    return "No emotion found."
}
/**
 * In this exercise, you are given a dictionary named 'emotionsDict' which contains emotions as keys and their corresponding intensities as values. Your task is to loop through the dictionary and find the emotion with the highest intensity.
 *
 * To solve this exercise, you can make use of a built-in function that retrieves the maximum value from a sequence.
 *
 * Your goal is to complete the code to find the emotion with the highest intensity and return it.
 *
 * Example:
 * val emotionsDict = mapOf("Anger" to 9, "Happiness" to 6, "Sadness" to 8, "Fear" to 7)
 * analyzeEmotions(emotionsDict)
 *
 * Expected Output:
 * The emotion with the highest intensity is Anger.
 *
 * Note:
 * The code should be able to handle any dictionary with emotions and intensities.
 */
fun analyzeEmotions(emotionsDict: Map<String, Int>): String {
/**
 * In this exercise, you are given a dictionary named 'emotionsDict' which contains emotions as keys and their corresponding intensities as values. Your task is to loop through the dictionary and find the emotion with the highest intensity.
 *
 * To solve this exercise, you can make use of a built-in function that retrieves the maximum value from a sequence.
 *
 * Your goal is to complete the code to find the emotion with the highest intensity and return it.
 *
 * Example:
 * val emotionsDict = mapOf("Anger" to 9, "Happiness" to 6, "Sadness" to 8, "Fear" to 7)
 * analyzeEmotions(emotionsDict)
 *
 * Expected Output:
 * The emotion with the highest intensity is Anger.
 *
 * Note:
 * The code should be able to handle any dictionary with emotions and intensities.
 */
fun analyzeEmotions(emotionsDict: Map<String, Int>): String {

    val maxIntensity = emotionsDict.values.maxOrNull() ?: return "No emotion found."

    for ((emotion, intensity) in emotionsDict) {
        if (intensity == maxIntensity) {
            return "The emotion with the highest intensity is $emotion."
        }
    }

    return "No emotion found."
}