/**
 * This function takes a list of marketing campaigns and returns a Pair that contains
 * the name of the most successful campaign and the total number of leads generated.
 *
 * @param marketingCampaigns A list of maps representing marketing campaigns.
 *        Each map contains the campaign name and the number of leads generated.
 * @return A Pair with the name of the most successful campaign and the total number of leads generated.
 */
fun getMarketingData(marketingCampaigns: List<Map<String, Any>>): Pair<String, Int> {

    var highLeads = 0
    var mostSuccessfulCampaign = ""

    for (campaign in marketingCampaigns) {
        val leads = campaign["leads"] as? Int ?: 0
        if (leads > highLeads) {
            highLeads = leads
            mostSuccessfulCampaign = campaign["name"] as? String ?: ""
        }
    }

    return Pair(mostSuccessfulCampaign, highLeads)
}
/**
 * This function takes a list of marketing campaigns and returns a Pair that contains
 * the name of the most successful campaign and the total number of leads generated.
 *
 * @param marketingCampaigns A list of maps representing marketing campaigns.
 *        Each map contains the campaign name and the number of leads generated.
 * @return A Pair with the name of the most successful campaign and the total number of leads generated.
 */
fun getMarketingData(marketingCampaigns: List<Map<String, Any>>): Pair<String, Int> {
/**
 * This function takes a list of marketing campaigns and returns a Pair that contains
 * the name of the most successful campaign and the total number of leads generated.
 *
 * @param marketingCampaigns A list of maps representing marketing campaigns.
 *        Each map contains the campaign name and the number of leads generated.
 * @return A Pair with the name of the most successful campaign and the total number of leads generated.
 */
fun getMarketingData(marketingCampaigns: List<Map<String, Any>>): Pair<String, Int> {

    var highLeads = 0
    var mostSuccessfulCampaign = ""

    for (campaign in marketingCampaigns) {
        val leads = campaign["leads"] as? Int ?: 0
        if (leads > highLeads) {
            highLeads = leads
            mostSuccessfulCampaign = campaign["name"] as? String ?: ""
        }
    }

    return Pair(mostSuccessfulCampaign, highLeads)
}