/**
 * This function takes two lists of crops planted by two farmers and returns a new list containing
 * the crops that are common to both farmers.
 *
 * @param farmer1Crops List of crops planted by farmer 1.
 * @param farmer2Crops List of crops planted by farmer 2.
 * @return List of crops that are common to both farmers.
 */
fun findCommonCrops(farmer1Crops: List<String>, farmer2Crops: List<String>): List<String> {

    // Initialize an empty list to store common crops
    val commonCrops = mutableListOf<String>()

    // Iterate through each crop in farmer 1's list
    for (crop in farmer1Crops) {
        // Check if the crop is also present in farmer 2's list
        if (crop in farmer2Crops) {
            // Add the crop to the common crops list
            commonCrops.add(crop)
        }
    }

    // Return the common crops list
    return commonCrops
}
/**
 * This function takes two lists of crops planted by two farmers and returns a new list containing
 * the crops that are common to both farmers.
 *
 * @param farmer1Crops List of crops planted by farmer 1.
 * @param farmer2Crops List of crops planted by farmer 2.
 * @return List of crops that are common to both farmers.
 */
fun findCommonCrops(farmer1Crops: List<String>, farmer2Crops: List<String>): List<String> {
/**
 * This function takes two lists of crops planted by two farmers and returns a new list containing
 * the crops that are common to both farmers.
 *
 * @param farmer1Crops List of crops planted by farmer 1.
 * @param farmer2Crops List of crops planted by farmer 2.
 * @return List of crops that are common to both farmers.
 */
fun findCommonCrops(farmer1Crops: List<String>, farmer2Crops: List<String>): List<String> {

    // Initialize an empty list to store common crops
    val commonCrops = mutableListOf<String>()

    // Iterate through each crop in farmer 1's list
    for (crop in farmer1Crops) {
        // Check if the crop is also present in farmer 2's list
        if (crop in farmer2Crops) {
            // Add the crop to the common crops list
            commonCrops.add(crop)
        }
    }

    // Return the common crops list
    return commonCrops
}