/**
 * This function takes a list of farmers and their crops, and returns a dictionary of farmers and the total number of crops they have.
 */
fun createFarmerDictionary(farmersList: List<String>): Map<String, Int> {

    // Create an empty dictionary to store the farmer and crop information
    val farmerDict = mutableMapOf<String, Int>()

    // Loop through each item in the farmersList
    for (item in farmersList) {
        // Split the item into farmer and crop information
        val (farmer, crop) = item.split(':')

        // Check if the farmer already exists in the dictionary
        if (farmer in farmerDict) {
            // If the farmer exists, add the crop to the existing total
            farmerDict[farmer] = farmerDict[farmer]!! + crop.toInt()
        } else {
            // If the farmer doesn't exist, add the farmer to the dictionary with the crop as the initial total
            farmerDict[farmer] = crop.toInt()
        }
    }

    return farmerDict
}
/**
 * This function takes a list of farmers and their crops, and returns a dictionary of farmers and the total number of crops they have.
 */
fun createFarmerDictionary(farmersList: List<String>): Map<String, Int> {
/**
 * This function takes a list of farmers and their crops, and returns a dictionary of farmers and the total number of crops they have.
 */
fun createFarmerDictionary(farmersList: List<String>): Map<String, Int> {

    // Create an empty dictionary to store the farmer and crop information
    val farmerDict = mutableMapOf<String, Int>()

    // Loop through each item in the farmersList
    for (item in farmersList) {
        // Split the item into farmer and crop information
        val (farmer, crop) = item.split(':')

        // Check if the farmer already exists in the dictionary
        if (farmer in farmerDict) {
            // If the farmer exists, add the crop to the existing total
            farmerDict[farmer] = farmerDict[farmer]!! + crop.toInt()
        } else {
            // If the farmer doesn't exist, add the farmer to the dictionary with the crop as the initial total
            farmerDict[farmer] = crop.toInt()
        }
    }

    return farmerDict
}