/**
 * Given the current population and birth/death rates,
 * calculate the number of years it will take for the population to reach 1 million,
 * assuming a constant birth and death rate.
 */
fun calculateYears(population: Int, birthRate: Double, deathRate: Double): Int {

    var years = 0
    var currentPopulation = population

    while (currentPopulation < 1000000) {
        currentPopulation += (currentPopulation * (birthRate - deathRate)).toInt()
        years++
    }

    return years
}
/**
 * Given the current population and birth/death rates,
 * calculate the number of years it will take for the population to reach 1 million,
 * assuming a constant birth and death rate.
 */
fun calculateYears(population: Int, birthRate: Double, deathRate: Double): Int {
/**
 * Given the current population and birth/death rates,
 * calculate the number of years it will take for the population to reach 1 million,
 * assuming a constant birth and death rate.
 */
fun calculateYears(population: Int, birthRate: Double, deathRate: Double): Int {

    var years = 0
    var currentPopulation = population

    while (currentPopulation < 1000000) {
        currentPopulation += (currentPopulation * (birthRate - deathRate)).toInt()
        years++
    }

    return years
}