/**
 * In this exercise, write a function that takes in a dictionary and finds the smallest value within it.
 * You should return the key that corresponds to the smallest value found.
 *
 * Example:
 * val dictionary = mapOf('a' to 10, 'b' to 5, 'c' to 15)
 * findSmallestValue(dictionary)
 * Output: 'b'
 */
fun findSmallestValue(dictionary: Map<String, Int>): String? {

    var smallestValue = Int.MAX_VALUE

    for ((_, value) in dictionary) {
        if (value < smallestValue) {
            smallestValue = value
        }
    }

    var smallestKey: String? = null

    for ((key, value) in dictionary) {
        if (value == smallestValue) {
            smallestKey = key
            break
        }
    }

    return smallestKey
}
/**
 * In this exercise, write a function that takes in a dictionary and finds the smallest value within it.
 * You should return the key that corresponds to the smallest value found.
 *
 * Example:
 * val dictionary = mapOf('a' to 10, 'b' to 5, 'c' to 15)
 * findSmallestValue(dictionary)
 * Output: 'b'
 */
fun findSmallestValue(dictionary: Map<String, Int>): String? {
/**
 * In this exercise, write a function that takes in a dictionary and finds the smallest value within it.
 * You should return the key that corresponds to the smallest value found.
 *
 * Example:
 * val dictionary = mapOf('a' to 10, 'b' to 5, 'c' to 15)
 * findSmallestValue(dictionary)
 * Output: 'b'
 */
fun findSmallestValue(dictionary: Map<String, Int>): String? {

    var smallestValue = Int.MAX_VALUE

    for ((_, value) in dictionary) {
        if (value < smallestValue) {
            smallestValue = value
        }
    }

    var smallestKey: String? = null

    for ((key, value) in dictionary) {
        if (value == smallestValue) {
            smallestKey = key
            break
        }
    }

    return smallestKey
}