/**
 * A function to calculate the number of months it takes for an Accountant to reach a target profit.
 *
 * @param accounts A list of monthly profits for each month.
 * @param targetProfit The desired target profit.
 * @return The number of months it takes to reach the target profit.
 */
fun calculateProfit(accounts: List<Double>, targetProfit: Double): Int {

    var totalProfit = 0.0
    var numMonths = 0

    while (totalProfit < targetProfit) {
        totalProfit += accounts[numMonths]
        numMonths++
    }

    return numMonths
}
/**
 * A function to calculate the number of months it takes for an Accountant to reach a target profit.
 *
 * @param accounts A list of monthly profits for each month.
 * @param targetProfit The desired target profit.
 * @return The number of months it takes to reach the target profit.
 */
fun calculateProfit(accounts: List<Double>, targetProfit: Double): Int {
/**
 * A function to calculate the number of months it takes for an Accountant to reach a target profit.
 *
 * @param accounts A list of monthly profits for each month.
 * @param targetProfit The desired target profit.
 * @return The number of months it takes to reach the target profit.
 */
fun calculateProfit(accounts: List<Double>, targetProfit: Double): Int {

    var totalProfit = 0.0
    var numMonths = 0

    while (totalProfit < targetProfit) {
        totalProfit += accounts[numMonths]
        numMonths++
    }

    return numMonths
}