/**
 * This function compares two marketing campaigns and determines which one is more successful.
 *
 * @param campaign1 A tuple representing the first marketing campaign, containing the campaign name, number of leads generated, and conversion rate.
 * @param campaign2 A tuple representing the second marketing campaign, containing the campaign name, number of leads generated, and conversion rate.
 * @return The campaign name that performed better or 'Both campaigns are equally successful' if their performance is equal.
 */
fun compareCampaigns(campaign1: Triple<String, Int, Double>, campaign2: Triple<String, Int, Double>): String {

    val (campaignName1, leadsGenerated1, conversionRate1) = campaign1
    val (campaignName2, leadsGenerated2, conversionRate2) = campaign2

    val totalSales1 = leadsGenerated1 * conversionRate1
    val totalSales2 = leadsGenerated2 * conversionRate2

    return when {
        totalSales1 > totalSales2 -> "$campaignName1 is more successful."
        totalSales1 < totalSales2 -> "$campaignName2 is more successful."
        else -> "Both campaigns are equally successful."
    }
}
/**
 * This function compares two marketing campaigns and determines which one is more successful.
 *
 * @param campaign1 A tuple representing the first marketing campaign, containing the campaign name, number of leads generated, and conversion rate.
 * @param campaign2 A tuple representing the second marketing campaign, containing the campaign name, number of leads generated, and conversion rate.
 * @return The campaign name that performed better or 'Both campaigns are equally successful' if their performance is equal.
 */
fun compareCampaigns(campaign1: Triple<String, Int, Double>, campaign2: Triple<String, Int, Double>): String {
/**
 * This function compares two marketing campaigns and determines which one is more successful.
 *
 * @param campaign1 A tuple representing the first marketing campaign, containing the campaign name, number of leads generated, and conversion rate.
 * @param campaign2 A tuple representing the second marketing campaign, containing the campaign name, number of leads generated, and conversion rate.
 * @return The campaign name that performed better or 'Both campaigns are equally successful' if their performance is equal.
 */
fun compareCampaigns(campaign1: Triple<String, Int, Double>, campaign2: Triple<String, Int, Double>): String {

    val (campaignName1, leadsGenerated1, conversionRate1) = campaign1
    val (campaignName2, leadsGenerated2, conversionRate2) = campaign2

    val totalSales1 = leadsGenerated1 * conversionRate1
    val totalSales2 = leadsGenerated2 * conversionRate2

    return when {
        totalSales1 > totalSales2 -> "$campaignName1 is more successful."
        totalSales1 < totalSales2 -> "$campaignName2 is more successful."
        else -> "Both campaigns are equally successful."
    }
}