/**
 * A farmer keeps track of the harvest from different crops using a dictionary.
 * The farmer wants to find the number of crops that produced a yield greater than a given threshold.
 * Complete the code to iterate over the dictionary and count the number of crops that meet the criteria.
 *
 * @param farm A dictionary where the keys represent crop names and the values represent the yields.
 * @return The number of crops with a yield greater than the threshold.
 */
fun farmerHarvest(farm: Map<String, Int>): Int {

    val threshold = 500  // Set the threshold yield for a crop to be considered
    var count = 0  // Initialize count variable to keep track of crops meeting the criteria

    for ((crop, yield) in farm) {
        if (yield > threshold) {
            count++  // Increment count if the crop yield is greater than the threshold
        }
    }

    return count
}
/**
 * A farmer keeps track of the harvest from different crops using a dictionary.
 * The farmer wants to find the number of crops that produced a yield greater than a given threshold.
 * Complete the code to iterate over the dictionary and count the number of crops that meet the criteria.
 *
 * @param farm A dictionary where the keys represent crop names and the values represent the yields.
 * @return The number of crops with a yield greater than the threshold.
 */
fun farmerHarvest(farm: Map<String, Int>): Int {
/**
 * A farmer keeps track of the harvest from different crops using a dictionary.
 * The farmer wants to find the number of crops that produced a yield greater than a given threshold.
 * Complete the code to iterate over the dictionary and count the number of crops that meet the criteria.
 *
 * @param farm A dictionary where the keys represent crop names and the values represent the yields.
 * @return The number of crops with a yield greater than the threshold.
 */
fun farmerHarvest(farm: Map<String, Int>): Int {

    val threshold = 500  // Set the threshold yield for a crop to be considered
    var count = 0  // Initialize count variable to keep track of crops meeting the criteria

    for ((crop, yield) in farm) {
        if (yield > threshold) {
            count++  // Increment count if the crop yield is greater than the threshold
        }
    }

    return count
}