/**
 * This function checks the return on investment (ROI) for a marketing campaign.
 * The campaignData parameter is a map containing different marketing metrics.
 * Complete the code to calculate the ROI and return a message based on certain conditions.
 *
 * @param campaignData a map containing the following keys:
 *                     - "estimated_cost" (Double): the estimated cost of the marketing campaign
 *                     - "actual_cost" (Double): the actual cost of the marketing campaign
 *                     - "estimated_revenue" (Double): the estimated revenue of the marketing campaign
 *                     - "actual_revenue" (Double): the actual revenue of the marketing campaign
 *
 * @return a message indicating the performance of the marketing campaign based on the ROI
 */
fun checkCampaignROI(campaignData: Map<String, Double>): String {

    if (campaignData["actual_cost"]!! < campaignData["estimated_cost"]!! &&
        campaignData["actual_revenue"]!! > campaignData["estimated_revenue"]!!
    ) {
        return "The campaign has exceeded the estimated revenue and saved costs. Excellent job!"
    } else if ((campaignData["actual_cost"]!! < campaignData["estimated_cost"]!!) ||
        (campaignData["actual_revenue"]!! > campaignData["estimated_revenue"]!!)
    ) {
        return "The campaign has either saved costs or exceeded revenue. Good job!"
    } else {
        return "The campaign did not meet the expected performance. Keep optimizing."
    }
}
/**
 * This function checks the return on investment (ROI) for a marketing campaign.
 * The campaignData parameter is a map containing different marketing metrics.
 * Complete the code to calculate the ROI and return a message based on certain conditions.
 *
 * @param campaignData a map containing the following keys:
 *                     - "estimated_cost" (Double): the estimated cost of the marketing campaign
 *                     - "actual_cost" (Double): the actual cost of the marketing campaign
 *                     - "estimated_revenue" (Double): the estimated revenue of the marketing campaign
 *                     - "actual_revenue" (Double): the actual revenue of the marketing campaign
 *
 * @return a message indicating the performance of the marketing campaign based on the ROI
 */
fun checkCampaignROI(campaignData: Map<String, Double>): String {
/**
 * This function checks the return on investment (ROI) for a marketing campaign.
 * The campaignData parameter is a map containing different marketing metrics.
 * Complete the code to calculate the ROI and return a message based on certain conditions.
 *
 * @param campaignData a map containing the following keys:
 *                     - "estimated_cost" (Double): the estimated cost of the marketing campaign
 *                     - "actual_cost" (Double): the actual cost of the marketing campaign
 *                     - "estimated_revenue" (Double): the estimated revenue of the marketing campaign
 *                     - "actual_revenue" (Double): the actual revenue of the marketing campaign
 *
 * @return a message indicating the performance of the marketing campaign based on the ROI
 */
fun checkCampaignROI(campaignData: Map<String, Double>): String {

    if (campaignData["actual_cost"]!! < campaignData["estimated_cost"]!! &&
        campaignData["actual_revenue"]!! > campaignData["estimated_revenue"]!!
    ) {
        return "The campaign has exceeded the estimated revenue and saved costs. Excellent job!"
    } else if ((campaignData["actual_cost"]!! < campaignData["estimated_cost"]!!) ||
        (campaignData["actual_revenue"]!! > campaignData["estimated_revenue"]!!)
    ) {
        return "The campaign has either saved costs or exceeded revenue. Good job!"
    } else {
        return "The campaign did not meet the expected performance. Keep optimizing."
    }
}