/**
 * Given a dictionary 'farmers_crops' and a set 'farmers_tools', find the common elements between them.
 *
 * @param farmersCrops A dictionary where the keys are crops and the values are the corresponding quantities.
 * @param farmersTools A set consisting of tools used by the farmer.
 * @return A set containing the common elements between 'farmers_crops' and 'farmers_tools'.
 */
fun findCommonElements(farmersCrops: Map<String, Int>, farmersTools: Set<String>): Set<String> {

    // Initialize an empty set to store the common elements
    val commonElements = mutableSetOf<String>()

    // Loop through each key-value pair in the 'farmersCrops' map
    for ((crop, _) in farmersCrops) {
        // Iterate through each tool in the 'farmersTools' set
        for (tool in farmersTools) {
            // Check if the crop matches the tool
            if (crop == tool) {
                // Add the common element to the 'commonElements' set
                commonElements.add(crop)
            }
        }
    }

    return commonElements
}
/**
 * Given a dictionary 'farmers_crops' and a set 'farmers_tools', find the common elements between them.
 *
 * @param farmersCrops A dictionary where the keys are crops and the values are the corresponding quantities.
 * @param farmersTools A set consisting of tools used by the farmer.
 * @return A set containing the common elements between 'farmers_crops' and 'farmers_tools'.
 */
fun findCommonElements(farmersCrops: Map<String, Int>, farmersTools: Set<String>): Set<String> {
/**
 * Given a dictionary 'farmers_crops' and a set 'farmers_tools', find the common elements between them.
 *
 * @param farmersCrops A dictionary where the keys are crops and the values are the corresponding quantities.
 * @param farmersTools A set consisting of tools used by the farmer.
 * @return A set containing the common elements between 'farmers_crops' and 'farmers_tools'.
 */
fun findCommonElements(farmersCrops: Map<String, Int>, farmersTools: Set<String>): Set<String> {

    // Initialize an empty set to store the common elements
    val commonElements = mutableSetOf<String>()

    // Loop through each key-value pair in the 'farmersCrops' map
    for ((crop, _) in farmersCrops) {
        // Iterate through each tool in the 'farmersTools' set
        for (tool in farmersTools) {
            // Check if the crop matches the tool
            if (crop == tool) {
                // Add the common element to the 'commonElements' set
                commonElements.add(crop)
            }
        }
    }

    return commonElements
}