/**
 * A farmer is planning to plant different crops on his field.
 * He has a list of crops he wants to plant and a list of crops already planted.
 * Write a function that takes these two lists as input and returns a list of crops that he has not yet planted.
 *
 * @param farmer A map containing the lists of crops to be planted and already planted.
 * @return A list of crops not yet planted by the farmer.
 */
fun findUnplantedCrops(farmer: Map<String, List<String>>): List<String> {

    val unplantedCrops = mutableListOf<String>()

    // Nested loops to compare each crop in the list of plants to each crop in the list of already planted crops
    for (crop in farmer["crops_to_plant"]!!) {
        var planted = false  // Flag to check if a crop is already planted
        for (plant in farmer["crops_planted"]!!) {
            if (crop == plant) {
                planted = true  // Crop is already planted
                break
            }
        }

        if (!planted) {
            unplantedCrops.add(crop)  // Crop is not planted yet
        }
    }

    return unplantedCrops
}
/**
 * A farmer is planning to plant different crops on his field.
 * He has a list of crops he wants to plant and a list of crops already planted.
 * Write a function that takes these two lists as input and returns a list of crops that he has not yet planted.
 *
 * @param farmer A map containing the lists of crops to be planted and already planted.
 * @return A list of crops not yet planted by the farmer.
 */
fun findUnplantedCrops(farmer: Map<String, List<String>>): List<String> {
/**
 * A farmer is planning to plant different crops on his field.
 * He has a list of crops he wants to plant and a list of crops already planted.
 * Write a function that takes these two lists as input and returns a list of crops that he has not yet planted.
 *
 * @param farmer A map containing the lists of crops to be planted and already planted.
 * @return A list of crops not yet planted by the farmer.
 */
fun findUnplantedCrops(farmer: Map<String, List<String>>): List<String> {

    val unplantedCrops = mutableListOf<String>()

    // Nested loops to compare each crop in the list of plants to each crop in the list of already planted crops
    for (crop in farmer["crops_to_plant"]!!) {
        var planted = false  // Flag to check if a crop is already planted
        for (plant in farmer["crops_planted"]!!) {
            if (crop == plant) {
                planted = true  // Crop is already planted
                break
            }
        }

        if (!planted) {
            unplantedCrops.add(crop)  // Crop is not planted yet
        }
    }

    return unplantedCrops
}