/**
 * You are given a map that contains data of different athletes participating in a race.
 * Each athlete is represented by a string key and their corresponding race time in seconds as the value.
 * Your task is to find and return the name of the athlete who has the slowest race time.
 *
 * @param athletes A map containing athlete names as keys and their corresponding race times in seconds as values
 * @return The name of the athlete with the slowest race time
 *
 * Example:
 * val athletes = mapOf("John" to 150, "Emily" to 160, "David" to 170, "Sarah" to 140, "Michael" to 180)
 * getSlowestAthlete(athletes) // Output: "Michael"
 */
fun getSlowestAthlete(athletes: Map<String, Int>): String {

    var slowestAthlete: String? = null
    var slowestTime = Int.MIN_VALUE

    for ((athlete, raceTime) in athletes) {
        if (raceTime > slowestTime) {
            slowestAthlete = athlete
            slowestTime = raceTime
        }
    }

    return slowestAthlete ?: ""
}
/**
 * You are given a map that contains data of different athletes participating in a race.
 * Each athlete is represented by a string key and their corresponding race time in seconds as the value.
 * Your task is to find and return the name of the athlete who has the slowest race time.
 *
 * @param athletes A map containing athlete names as keys and their corresponding race times in seconds as values
 * @return The name of the athlete with the slowest race time
 *
 * Example:
 * val athletes = mapOf("John" to 150, "Emily" to 160, "David" to 170, "Sarah" to 140, "Michael" to 180)
 * getSlowestAthlete(athletes) // Output: "Michael"
 */
fun getSlowestAthlete(athletes: Map<String, Int>): String {
/**
 * You are given a map that contains data of different athletes participating in a race.
 * Each athlete is represented by a string key and their corresponding race time in seconds as the value.
 * Your task is to find and return the name of the athlete who has the slowest race time.
 *
 * @param athletes A map containing athlete names as keys and their corresponding race times in seconds as values
 * @return The name of the athlete with the slowest race time
 *
 * Example:
 * val athletes = mapOf("John" to 150, "Emily" to 160, "David" to 170, "Sarah" to 140, "Michael" to 180)
 * getSlowestAthlete(athletes) // Output: "Michael"
 */
fun getSlowestAthlete(athletes: Map<String, Int>): String {

    var slowestAthlete: String? = null
    var slowestTime = Int.MIN_VALUE

    for ((athlete, raceTime) in athletes) {
        if (raceTime > slowestTime) {
            slowestAthlete = athlete
            slowestTime = raceTime
        }
    }

    return slowestAthlete ?: ""
}