/**
 * A Farmer needs to harvest vegetables from his farm.
 * The farmer plants tomatoes, onions, carrots, and radishes
 * in different patches of his farm.
 *
 * You need to implement the code to find the index of the
 * vegetable that is ready to be harvested.
 *
 * The farmer wants to prioritize harvesting the vegetables
 * that have a longer growth period.
 *
 * The vegetables and their growth periods are as follows:
 * - Tomato: 70 days
 * - Onion: 90 days
 * - Carrot: 80 days
 * - Radish: 60 days
 *
 * If none of the vegetables are ready to be harvested,
 * return "No vegetables ready yet!"
 *
 * Complete the code below to solve the exercise.
 */
fun harvest(tomato: Int, onion: Int, carrot: Int, radish: Int): Any {

    val vegetables = listOf("Tomato", "Onion", "Carrot", "Radish")
    val growthPeriod = listOf(70, 90, 80, 60)

    val maxGrowthPeriod = growthPeriod.maxOrNull()

    for (index in vegetables.indices) {
        if (growthPeriod[index] == maxGrowthPeriod) {
            return index
        }
    }

    return "No vegetables ready yet!"
}
/**
 * A Farmer needs to harvest vegetables from his farm.
 * The farmer plants tomatoes, onions, carrots, and radishes
 * in different patches of his farm.
 *
 * You need to implement the code to find the index of the
 * vegetable that is ready to be harvested.
 *
 * The farmer wants to prioritize harvesting the vegetables
 * that have a longer growth period.
 *
 * The vegetables and their growth periods are as follows:
 * - Tomato: 70 days
 * - Onion: 90 days
 * - Carrot: 80 days
 * - Radish: 60 days
 *
 * If none of the vegetables are ready to be harvested,
 * return "No vegetables ready yet!"
 *
 * Complete the code below to solve the exercise.
 */
fun harvest(tomato: Int, onion: Int, carrot: Int, radish: Int): Any {
/**
 * A Farmer needs to harvest vegetables from his farm.
 * The farmer plants tomatoes, onions, carrots, and radishes
 * in different patches of his farm.
 *
 * You need to implement the code to find the index of the
 * vegetable that is ready to be harvested.
 *
 * The farmer wants to prioritize harvesting the vegetables
 * that have a longer growth period.
 *
 * The vegetables and their growth periods are as follows:
 * - Tomato: 70 days
 * - Onion: 90 days
 * - Carrot: 80 days
 * - Radish: 60 days
 *
 * If none of the vegetables are ready to be harvested,
 * return "No vegetables ready yet!"
 *
 * Complete the code below to solve the exercise.
 */
fun harvest(tomato: Int, onion: Int, carrot: Int, radish: Int): Any {

    val vegetables = listOf("Tomato", "Onion", "Carrot", "Radish")
    val growthPeriod = listOf(70, 90, 80, 60)

    val maxGrowthPeriod = growthPeriod.maxOrNull()

    for (index in vegetables.indices) {
        if (growthPeriod[index] == maxGrowthPeriod) {
            return index
        }
    }

    return "No vegetables ready yet!"
}