/**
 * Given a dictionary 'data' with string keys and integer values, find the key with the largest value.
 *
 * @param data A dictionary with string keys and integer values.
 * @return The key with the largest value.
 *
 * Example:
 * findLargestValue(mapOf("apple" to 5, "banana" to 10, "orange" to 3)) // Output: "banana"
 * findLargestValue(mapOf("cat" to 8, "dog" to 12, "elephant" to 6)) // Output: "dog"
 */
fun findLargestValue(data: Map<String, Int>): String {

    var largest: String? = null  // Initialize largest variable to null
    var largestValue = Int.MIN_VALUE  // Initialize largest value to the minimum integer value

    for ((key, value) in data) {
        if (value > largestValue) {  // If current value is larger than the largest value found so far
            largest = key  // Store the current key as the largest
            largestValue = value  // Update the largest value
        }
    }

    return largest ?: ""  // Return the largest key or an empty string if no key is found
}
/**
 * Given a dictionary 'data' with string keys and integer values, find the key with the largest value.
 *
 * @param data A dictionary with string keys and integer values.
 * @return The key with the largest value.
 *
 * Example:
 * findLargestValue(mapOf("apple" to 5, "banana" to 10, "orange" to 3)) // Output: "banana"
 * findLargestValue(mapOf("cat" to 8, "dog" to 12, "elephant" to 6)) // Output: "dog"
 */
fun findLargestValue(data: Map<String, Int>): String {
/**
 * Given a dictionary 'data' with string keys and integer values, find the key with the largest value.
 *
 * @param data A dictionary with string keys and integer values.
 * @return The key with the largest value.
 *
 * Example:
 * findLargestValue(mapOf("apple" to 5, "banana" to 10, "orange" to 3)) // Output: "banana"
 * findLargestValue(mapOf("cat" to 8, "dog" to 12, "elephant" to 6)) // Output: "dog"
 */
fun findLargestValue(data: Map<String, Int>): String {

    var largest: String? = null  // Initialize largest variable to null
    var largestValue = Int.MIN_VALUE  // Initialize largest value to the minimum integer value

    for ((key, value) in data) {
        if (value > largestValue) {  // If current value is larger than the largest value found so far
            largest = key  // Store the current key as the largest
            largestValue = value  // Update the largest value
        }
    }

    return largest ?: ""  // Return the largest key or an empty string if no key is found
}