/**
 * Given the dimensions of a wooden board and an extra width to be subtracted,
 * modify the dimensions in-place by slicing and return the modified dimensions.
 *
 * @param dimensions A list of floating-point numbers representing the width and height of the wooden board.
 * @param extraWidth The additional width to be subtracted from the board's dimensions.
 * @return The modified dimensions after subtracting the extra width.
 *
 * Example:
 * subtractWidths(listOf(10.5, 5.25), 2.5) => [8.0, 5.25]
 * subtractWidths(listOf(18.75, 4.0), 1.5) => [17.25, 4.0]
 */
fun subtractWidths(dimensions: MutableList<Double>, extraWidth: Double): List<Double> {

    // Subtract the extra width from the board's dimensions using slicing
    dimensions[0] -= extraWidth

    // Return the modified dimensions
    return dimensions
}
/**
 * Given the dimensions of a wooden board and an extra width to be subtracted,
 * modify the dimensions in-place by slicing and return the modified dimensions.
 *
 * @param dimensions A list of floating-point numbers representing the width and height of the wooden board.
 * @param extraWidth The additional width to be subtracted from the board's dimensions.
 * @return The modified dimensions after subtracting the extra width.
 *
 * Example:
 * subtractWidths(listOf(10.5, 5.25), 2.5) => [8.0, 5.25]
 * subtractWidths(listOf(18.75, 4.0), 1.5) => [17.25, 4.0]
 */
fun subtractWidths(dimensions: MutableList<Double>, extraWidth: Double): List<Double> {
/**
 * Given the dimensions of a wooden board and an extra width to be subtracted,
 * modify the dimensions in-place by slicing and return the modified dimensions.
 *
 * @param dimensions A list of floating-point numbers representing the width and height of the wooden board.
 * @param extraWidth The additional width to be subtracted from the board's dimensions.
 * @return The modified dimensions after subtracting the extra width.
 *
 * Example:
 * subtractWidths(listOf(10.5, 5.25), 2.5) => [8.0, 5.25]
 * subtractWidths(listOf(18.75, 4.0), 1.5) => [17.25, 4.0]
 */
fun subtractWidths(dimensions: MutableList<Double>, extraWidth: Double): List<Double> {

    // Subtract the extra width from the board's dimensions using slicing
    dimensions[0] -= extraWidth

    // Return the modified dimensions
    return dimensions
}