/**
 * A farmer wants to check the status of his crops and remove the ones that are fully grown.
 * Complete the code below to help the farmer identify the crops that need to be removed.
 * The function should return a list of crops that are ready to be harvested.
 */
fun checkCrops(farmer: String, crops: MutableList<Map<String, String>>): MutableList<Map<String, String>> {


    // Initialize an empty list to store the crops that are ready
    val fullyGrownCrops = mutableListOf<Map<String, String>>()

    // Iterate through all the crops in the given list
    var index = 0
    while (index < crops.size) {

        // Get the current crop from the list
        val currentCrop = crops[index]

        // Check if the current crop has fully grown
        if (currentCrop["growth_status"] == "Fully Grown") {

            // Remove the fully grown crop from the list and add it to the fullyGrownCrops list
            fullyGrownCrops.add(crops.removeAt(index))

        } else {
            // Move to the next crop
            index++
        }
    }

    // Return the list of crops that are ready for harvesting
    return fullyGrownCrops
}
/**
 * A farmer wants to check the status of his crops and remove the ones that are fully grown.
 * Complete the code below to help the farmer identify the crops that need to be removed.
 * The function should return a list of crops that are ready to be harvested.
 */
fun checkCrops(farmer: String, crops: MutableList<Map<String, String>>): MutableList<Map<String, String>> {
/**
 * A farmer wants to check the status of his crops and remove the ones that are fully grown.
 * Complete the code below to help the farmer identify the crops that need to be removed.
 * The function should return a list of crops that are ready to be harvested.
 */
fun checkCrops(farmer: String, crops: MutableList<Map<String, String>>): MutableList<Map<String, String>> {


    // Initialize an empty list to store the crops that are ready
    val fullyGrownCrops = mutableListOf<Map<String, String>>()

    // Iterate through all the crops in the given list
    var index = 0
    while (index < crops.size) {

        // Get the current crop from the list
        val currentCrop = crops[index]

        // Check if the current crop has fully grown
        if (currentCrop["growth_status"] == "Fully Grown") {

            // Remove the fully grown crop from the list and add it to the fullyGrownCrops list
            fullyGrownCrops.add(crops.removeAt(index))

        } else {
            // Move to the next crop
            index++
        }
    }

    // Return the list of crops that are ready for harvesting
    return fullyGrownCrops
}