/**
 * Calculates the tax payable based on the income of an accountant.
 *
 * @param income The income of the accountant.
 * @return The tax amount payable by the accountant.
 */
fun calculateTax(income: Int): Any {

    val taxBrackets = mapOf(
        "0-50000" to 0.1,
        "50001-100000" to 0.2,
        "100001-200000" to 0.3,
        "200001-500000" to 0.4,
        "500001 and above" to 0.5
    )

    // Finding the tax bracket based on the income
    for ((bracket, taxRate) in taxBrackets) {
        val (lowerLimit, upperLimit) = bracket.split('-').map { it.toInt() }
        if (lowerLimit <= income && income <= upperLimit) {
            val tax = income * taxRate
            return tax
        }
    }

    return "Invalid income"
}
/**
 * Calculates the tax payable based on the income of an accountant.
 *
 * @param income The income of the accountant.
 * @return The tax amount payable by the accountant.
 */
fun calculateTax(income: Int): Any {
/**
 * Calculates the tax payable based on the income of an accountant.
 *
 * @param income The income of the accountant.
 * @return The tax amount payable by the accountant.
 */
fun calculateTax(income: Int): Any {

    val taxBrackets = mapOf(
        "0-50000" to 0.1,
        "50001-100000" to 0.2,
        "100001-200000" to 0.3,
        "200001-500000" to 0.4,
        "500001 and above" to 0.5
    )

    // Finding the tax bracket based on the income
    for ((bracket, taxRate) in taxBrackets) {
        val (lowerLimit, upperLimit) = bracket.split('-').map { it.toInt() }
        if (lowerLimit <= income && income <= upperLimit) {
            val tax = income * taxRate
            return tax
        }
    }

    return "Invalid income"
}