/**
 * Given a list of patients and a number of treatment sessions,
 * this function calculates the total duration required for all patients to complete their treatment.
 *
 * @param patients A list of patient names.
 * @param sessions The number of treatment sessions for each patient.
 * @return The total duration required for all patients to complete their treatment.
 *
 * Note:
 * - Each treatment session has a fixed duration of 45 minutes.
 *
 * Example:
 * - Given patients = ['John', 'Emily', 'Michael'] and sessions = 10, the function should return 1350
 *   since each patient needs 10 sessions, resulting in a total of 30 sessions (10 sessions per patient),
 *   which will take 30 * 45 = 1350 minutes in total.
 */
fun calculateTreatmentDuration(patients: List<String>, sessions: Int): Int {

    var duration = 0
    for ((index, _) in patients.withIndex()) {
        duration += index * sessions * 45
    }
    return duration
}
/**
 * Given a list of patients and a number of treatment sessions,
 * this function calculates the total duration required for all patients to complete their treatment.
 *
 * @param patients A list of patient names.
 * @param sessions The number of treatment sessions for each patient.
 * @return The total duration required for all patients to complete their treatment.
 *
 * Note:
 * - Each treatment session has a fixed duration of 45 minutes.
 *
 * Example:
 * - Given patients = ['John', 'Emily', 'Michael'] and sessions = 10, the function should return 1350
 *   since each patient needs 10 sessions, resulting in a total of 30 sessions (10 sessions per patient),
 *   which will take 30 * 45 = 1350 minutes in total.
 */
fun calculateTreatmentDuration(patients: List<String>, sessions: Int): Int {
/**
 * Given a list of patients and a number of treatment sessions,
 * this function calculates the total duration required for all patients to complete their treatment.
 *
 * @param patients A list of patient names.
 * @param sessions The number of treatment sessions for each patient.
 * @return The total duration required for all patients to complete their treatment.
 *
 * Note:
 * - Each treatment session has a fixed duration of 45 minutes.
 *
 * Example:
 * - Given patients = ['John', 'Emily', 'Michael'] and sessions = 10, the function should return 1350
 *   since each patient needs 10 sessions, resulting in a total of 30 sessions (10 sessions per patient),
 *   which will take 30 * 45 = 1350 minutes in total.
 */
fun calculateTreatmentDuration(patients: List<String>, sessions: Int): Int {

    var duration = 0
    for ((index, _) in patients.withIndex()) {
        duration += index * sessions * 45
    }
    return duration
}