/**
 * Given the crops of two farmers, return a list of crops that are common to both farmers.
 *
 * @param farmer1Crops A list of crops grown by the first farmer.
 * @param farmer2Crops A list of crops grown by the second farmer.
 * @return A list of crops that are common to both farmers.
 *
 * Example:
 * farmer1Crops = listOf("corn", "wheat", "tomato", "potato")
 * farmer2Crops = listOf("corn", "potato", "carrot", "cabbage")
 * findCommonCrops(farmer1Crops, farmer2Crops) // Output: ["corn", "potato"]
 */
fun findCommonCrops(farmer1Crops: List<String>, farmer2Crops: List<String>): List<String> {

    val commonCrops = farmer1Crops.filter { it in farmer2Crops }
    return commonCrops
}
/**
 * Given the crops of two farmers, return a list of crops that are common to both farmers.
 *
 * @param farmer1Crops A list of crops grown by the first farmer.
 * @param farmer2Crops A list of crops grown by the second farmer.
 * @return A list of crops that are common to both farmers.
 *
 * Example:
 * farmer1Crops = listOf("corn", "wheat", "tomato", "potato")
 * farmer2Crops = listOf("corn", "potato", "carrot", "cabbage")
 * findCommonCrops(farmer1Crops, farmer2Crops) // Output: ["corn", "potato"]
 */
fun findCommonCrops(farmer1Crops: List<String>, farmer2Crops: List<String>): List<String> {
/**
 * Given the crops of two farmers, return a list of crops that are common to both farmers.
 *
 * @param farmer1Crops A list of crops grown by the first farmer.
 * @param farmer2Crops A list of crops grown by the second farmer.
 * @return A list of crops that are common to both farmers.
 *
 * Example:
 * farmer1Crops = listOf("corn", "wheat", "tomato", "potato")
 * farmer2Crops = listOf("corn", "potato", "carrot", "cabbage")
 * findCommonCrops(farmer1Crops, farmer2Crops) // Output: ["corn", "potato"]
 */
fun findCommonCrops(farmer1Crops: List<String>, farmer2Crops: List<String>): List<String> {

    val commonCrops = farmer1Crops.filter { it in farmer2Crops }
    return commonCrops
}