/**
 * Accepts the yield per acre of different crops and the land area allocated to each crop.
 * Returns the average yield across all crops.
 */
fun calculateAvgYield(yieldPerAcre: Map<String, Double>, landArea: Map<String, Double>): Double {

    var totalYield = 0.0
    var totalArea = 0.0
    for ((crop, yield) in yieldPerAcre) {
        totalYield += yield * (landArea[crop] ?: 0.0)
        totalArea += landArea[crop] ?: 0.0
    }
    return totalYield / totalArea
}
/**
 * Accepts the yield per acre of different crops and the land area allocated to each crop.
 * Returns the average yield across all crops.
 */
fun calculateAvgYield(yieldPerAcre: Map<String, Double>, landArea: Map<String, Double>): Double {
/**
 * Accepts the yield per acre of different crops and the land area allocated to each crop.
 * Returns the average yield across all crops.
 */
fun calculateAvgYield(yieldPerAcre: Map<String, Double>, landArea: Map<String, Double>): Double {

    var totalYield = 0.0
    var totalArea = 0.0
    for ((crop, yield) in yieldPerAcre) {
        totalYield += yield * (landArea[crop] ?: 0.0)
        totalArea += landArea[crop] ?: 0.0
    }
    return totalYield / totalArea
}