/**
 * This function takes a list of fruits and a target harvest amount,
 * and returns the total number of fruits that need to be harvested to
 * meet the target amount.
 */
fun calculateHarvest(fruits: List<String>, targetHarvest: Int): Int {

    var totalHarvest = 0

    for (fruit in fruits) {
        when (fruit) {
            "apple" -> totalHarvest += 3
            "banana" -> totalHarvest += 5
            "orange" -> totalHarvest += 2
            "grape" -> totalHarvest += 1
        }

        // TODO: Complete the code by adding a break statement in the appropriate place
    }

    return totalHarvest
}
/**
 * This function takes a list of fruits and a target harvest amount,
 * and returns the total number of fruits that need to be harvested to
 * meet the target amount.
 */
fun calculateHarvest(fruits: List<String>, targetHarvest: Int): Int {
/**
 * This function takes a list of fruits and a target harvest amount,
 * and returns the total number of fruits that need to be harvested to
 * meet the target amount.
 */
fun calculateHarvest(fruits: List<String>, targetHarvest: Int): Int {

    var totalHarvest = 0

    for (fruit in fruits) {
        when (fruit) {
            "apple" -> totalHarvest += 3
            "banana" -> totalHarvest += 5
            "orange" -> totalHarvest += 2
            "grape" -> totalHarvest += 1
        }

        // TODO: Complete the code by adding a break statement in the appropriate place
    }

    return totalHarvest
}