/**
 * Calculates the tax owed by an accountant based on their income and deductions.
 *
 * @param income The accountant's income for the year.
 * @param deductions The accountant's eligible deductions.
 * @return The amount of tax owed by the accountant after considering deductions.
 */
fun calculateTax(income: Double, deductions: Set<Double>): Double {

    // Determine the tax rate based on income thresholds
    val taxRate = if (income <= 50000) 0.2 else 0.3

    // Calculate the tax owed after deductions
    var taxOwed = income * taxRate - deductions.sum()

    // If taxOwed is negative, set it to 0
    if (taxOwed < 0) {
        taxOwed = 0.0
    }

    return taxOwed
}
/**
 * Calculates the tax owed by an accountant based on their income and deductions.
 *
 * @param income The accountant's income for the year.
 * @param deductions The accountant's eligible deductions.
 * @return The amount of tax owed by the accountant after considering deductions.
 */
fun calculateTax(income: Double, deductions: Set<Double>): Double {
/**
 * Calculates the tax owed by an accountant based on their income and deductions.
 *
 * @param income The accountant's income for the year.
 * @param deductions The accountant's eligible deductions.
 * @return The amount of tax owed by the accountant after considering deductions.
 */
fun calculateTax(income: Double, deductions: Set<Double>): Double {

    // Determine the tax rate based on income thresholds
    val taxRate = if (income <= 50000) 0.2 else 0.3

    // Calculate the tax owed after deductions
    var taxOwed = income * taxRate - deductions.sum()

    // If taxOwed is negative, set it to 0
    if (taxOwed < 0) {
        taxOwed = 0.0
    }

    return taxOwed
}