/**
 * Given a dictionary of monthly expenses, calculate the profit for each month.
 * The profit is calculated by subtracting the expenses from the total income for each month.
 *
 * @param expenses A dictionary where the keys represent the months (string) and the values represent the expenses (float).
 * @return A dictionary where the keys represent the months (string) and the values represent the profits (float).
 *
 * Example:
 * calculateProfitForEachMonth(mapOf("January" to 1000.0, "February" to 1500.0, "March" to 800.0)) -> 
 *      mapOf("January" to 4000.0, "February" to 3500.0, "March" to 4200.0)
 */
fun calculateProfitForEachMonth(expenses: Map<String, Double>): Map<String, Double> {

    val totalIncome = 5000.0 // Assume total income for the period is $5000
    val profits = mutableMapOf<String, Double>()

    for ((month, expense) in expenses) {
        val profit = totalIncome - expense
        profits[month] = profit
    }

    return profits
}
/**
 * Given a dictionary of monthly expenses, calculate the profit for each month.
 * The profit is calculated by subtracting the expenses from the total income for each month.
 *
 * @param expenses A dictionary where the keys represent the months (string) and the values represent the expenses (float).
 * @return A dictionary where the keys represent the months (string) and the values represent the profits (float).
 *
 * Example:
 * calculateProfitForEachMonth(mapOf("January" to 1000.0, "February" to 1500.0, "March" to 800.0)) -> 
 *      mapOf("January" to 4000.0, "February" to 3500.0, "March" to 4200.0)
 */
fun calculateProfitForEachMonth(expenses: Map<String, Double>): Map<String, Double> {
/**
 * Given a dictionary of monthly expenses, calculate the profit for each month.
 * The profit is calculated by subtracting the expenses from the total income for each month.
 *
 * @param expenses A dictionary where the keys represent the months (string) and the values represent the expenses (float).
 * @return A dictionary where the keys represent the months (string) and the values represent the profits (float).
 *
 * Example:
 * calculateProfitForEachMonth(mapOf("January" to 1000.0, "February" to 1500.0, "March" to 800.0)) -> 
 *      mapOf("January" to 4000.0, "February" to 3500.0, "March" to 4200.0)
 */
fun calculateProfitForEachMonth(expenses: Map<String, Double>): Map<String, Double> {

    val totalIncome = 5000.0 // Assume total income for the period is $5000
    val profits = mutableMapOf<String, Double>()

    for ((month, expense) in expenses) {
        val profit = totalIncome - expense
        profits[month] = profit
    }

    return profits
}