/**
 * This exercise is aimed at practicing modifying elements of a list using slicing and the range function.
 *
 * The patientData list contains the records of a physical therapy session. Each record represents the number of exercises performed by the patient during a session.
 *
 * Your task is to:
 * 1. Modify the elements in the given range, multiplying them by 2.
 * 2. Assign the modified elements back to the same range in patientData list.
 *
 * You need to complete the code to achieve the desired task.
 *
 * @param patientData A list of integers representing the number of exercises performed in each session.
 * @param startIndex An integer indicating the index to start modifying (inclusive).
 * @param endIndex An integer indicating the index to end modifying (exclusive).
 * @return The modified patientData list.
 */
fun modifyList(patientData: MutableList<Int>, startIndex: Int, endIndex: Int): List<Int> {

    // Modify the elements using a range loop and slicing
    for (i in startIndex until endIndex) {
        patientData[i] *= 2
    }
    return patientData
}

// Example usage
/**
 * This exercise is aimed at practicing modifying elements of a list using slicing and the range function.
 *
 * The patientData list contains the records of a physical therapy session. Each record represents the number of exercises performed by the patient during a session.
 *
 * Your task is to:
 * 1. Modify the elements in the given range, multiplying them by 2.
 * 2. Assign the modified elements back to the same range in patientData list.
 *
 * You need to complete the code to achieve the desired task.
 *
 * @param patientData A list of integers representing the number of exercises performed in each session.
 * @param startIndex An integer indicating the index to start modifying (inclusive).
 * @param endIndex An integer indicating the index to end modifying (exclusive).
 * @return The modified patientData list.
 */
fun modifyList(patientData: MutableList<Int>, startIndex: Int, endIndex: Int): List<Int> {
/**
 * This exercise is aimed at practicing modifying elements of a list using slicing and the range function.
 *
 * The patientData list contains the records of a physical therapy session. Each record represents the number of exercises performed by the patient during a session.
 *
 * Your task is to:
 * 1. Modify the elements in the given range, multiplying them by 2.
 * 2. Assign the modified elements back to the same range in patientData list.
 *
 * You need to complete the code to achieve the desired task.
 *
 * @param patientData A list of integers representing the number of exercises performed in each session.
 * @param startIndex An integer indicating the index to start modifying (inclusive).
 * @param endIndex An integer indicating the index to end modifying (exclusive).
 * @return The modified patientData list.
 */
fun modifyList(patientData: MutableList<Int>, startIndex: Int, endIndex: Int): List<Int> {

    // Modify the elements using a range loop and slicing
    for (i in startIndex until endIndex) {
        patientData[i] *= 2
    }
    return patientData
}

// Example usage