/**
 * This function takes in the area of a farm, a list of crop types, and a preferred soil type.
 * It returns a list of crops that can be planted on the farm, considering both short-circuiting and indexing.
 */
fun findCrops(farmArea: Int, cropTypes: List<String>, preferredSoil: Set<String>): List<String> {

    val compatibleCrops = mutableListOf<String>()

    var remainingFarmArea = farmArea
    for (crop in cropTypes) {
        if (crop in preferredSoil && remainingFarmArea > 0) {
            remainingFarmArea--
            compatibleCrops.add(crop)
        }
    }

    return compatibleCrops
}
/**
 * This function takes in the area of a farm, a list of crop types, and a preferred soil type.
 * It returns a list of crops that can be planted on the farm, considering both short-circuiting and indexing.
 */
fun findCrops(farmArea: Int, cropTypes: List<String>, preferredSoil: Set<String>): List<String> {
/**
 * This function takes in the area of a farm, a list of crop types, and a preferred soil type.
 * It returns a list of crops that can be planted on the farm, considering both short-circuiting and indexing.
 */
fun findCrops(farmArea: Int, cropTypes: List<String>, preferredSoil: Set<String>): List<String> {

    val compatibleCrops = mutableListOf<String>()

    var remainingFarmArea = farmArea
    for (crop in cropTypes) {
        if (crop in preferredSoil && remainingFarmArea > 0) {
            remainingFarmArea--
            compatibleCrops.add(crop)
        }
    }

    return compatibleCrops
}