/**
 * Check if the farmer's land is fertile enough to grow crops, and determine the best action for the farmer.
 *
 * @param area The total area of the farmer's land in hectares.
 * @param crops The list of crops the farmer intends to grow.
 * @return The recommended action for the farmer to take.
 */
fun isFertile(area: Double, crops: List<String>): String {

    // Calculate the minimum area required for each crop
    val minAreas = mapOf(
        "corn" to 2.5,
        "wheat" to 1.8,
        "soybeans" to 2.0,
        "potatoes" to 1.5
    )

    // Check if the area is sufficient for each crop
    for (crop in crops) {
        if (area < minAreas[crop] ?: 0.0) {
            // TODO: Use a break statement here to exit the loop if the area is not sufficient for any crop.
            return "Not enough land for crop: $crop"
        }
    }

    // TODO: Implement an alternative to ternary operator to determine the best action for the farmer.
    var optimalAction = ""
    if (crops.size > 3) {
        optimalAction = "Diversify crops"
    }

    return optimalAction
}
/**
 * Check if the farmer's land is fertile enough to grow crops, and determine the best action for the farmer.
 *
 * @param area The total area of the farmer's land in hectares.
 * @param crops The list of crops the farmer intends to grow.
 * @return The recommended action for the farmer to take.
 */
fun isFertile(area: Double, crops: List<String>): String {
/**
 * Check if the farmer's land is fertile enough to grow crops, and determine the best action for the farmer.
 *
 * @param area The total area of the farmer's land in hectares.
 * @param crops The list of crops the farmer intends to grow.
 * @return The recommended action for the farmer to take.
 */
fun isFertile(area: Double, crops: List<String>): String {

    // Calculate the minimum area required for each crop
    val minAreas = mapOf(
        "corn" to 2.5,
        "wheat" to 1.8,
        "soybeans" to 2.0,
        "potatoes" to 1.5
    )

    // Check if the area is sufficient for each crop
    for (crop in crops) {
        if (area < minAreas[crop] ?: 0.0) {
            // TODO: Use a break statement here to exit the loop if the area is not sufficient for any crop.
            return "Not enough land for crop: $crop"
        }
    }

    // TODO: Implement an alternative to ternary operator to determine the best action for the farmer.
    var optimalAction = ""
    if (crops.size > 3) {
        optimalAction = "Diversify crops"
    }

    return optimalAction
}