/**
 * This exercise focuses on creating a range of indices using start and stop parameters and then
 * accessing elements in a list to perform specific tasks for a carpenter.
 *
 * @param lengths A list of lengths of wood planks available to the carpenter.
 * @param start The starting index of the range.
 * @param stop The stopping index of the range.
 * @return An updated list of lengths of wood planks.
 */
fun cutWood(lengths: MutableList<Int>, start: Int, stop: Int): MutableList<Int> {

    // Step 1: Create a range of indices using the start and stop parameters
    val indices = (start until stop).toList()

    // Step 2: Access elements in the lengths list using the created range
    for (index in indices) {
        // Step 3: Perform specific task for the carpenter (e.g., cut the wood plank into half)
        lengths[index] /= 2
    }

    // Step 4: Return the updated list of lengths of wood planks
    return lengths
}

// Example usage
/**
 * This exercise focuses on creating a range of indices using start and stop parameters and then
 * accessing elements in a list to perform specific tasks for a carpenter.
 *
 * @param lengths A list of lengths of wood planks available to the carpenter.
 * @param start The starting index of the range.
 * @param stop The stopping index of the range.
 * @return An updated list of lengths of wood planks.
 */
fun cutWood(lengths: MutableList<Int>, start: Int, stop: Int): MutableList<Int> {
/**
 * This exercise focuses on creating a range of indices using start and stop parameters and then
 * accessing elements in a list to perform specific tasks for a carpenter.
 *
 * @param lengths A list of lengths of wood planks available to the carpenter.
 * @param start The starting index of the range.
 * @param stop The stopping index of the range.
 * @return An updated list of lengths of wood planks.
 */
fun cutWood(lengths: MutableList<Int>, start: Int, stop: Int): MutableList<Int> {

    // Step 1: Create a range of indices using the start and stop parameters
    val indices = (start until stop).toList()

    // Step 2: Access elements in the lengths list using the created range
    for (index in indices) {
        // Step 3: Perform specific task for the carpenter (e.g., cut the wood plank into half)
        lengths[index] /= 2
    }

    // Step 4: Return the updated list of lengths of wood planks
    return lengths
}

// Example usage