/**
 * A carpenter wants to modify the length of woods in inches using a for loop and list comprehensions.
 * Given a list of woods and the amount of inches to be added or subtracted, modify the length of each wood element accordingly.
 *
 * @param woods A list of wood lengths in inches.
 * @param inches The amount of inches to be added or subtracted from each wood length.
 * @return The modified list of wood lengths after adding or subtracting the specified amount of inches.
 *
 * Example:
 * modifyWoodLength(listOf(12, 18, 24, 36), 3) returns [15, 21, 27, 39]
 */
fun modifyWoodLength(woods: List<Int>, inches: Int): List<Int> {

    return woods.map { if (it % 2 == 0) it + inches else it - inches }
}
/**
 * A carpenter wants to modify the length of woods in inches using a for loop and list comprehensions.
 * Given a list of woods and the amount of inches to be added or subtracted, modify the length of each wood element accordingly.
 *
 * @param woods A list of wood lengths in inches.
 * @param inches The amount of inches to be added or subtracted from each wood length.
 * @return The modified list of wood lengths after adding or subtracting the specified amount of inches.
 *
 * Example:
 * modifyWoodLength(listOf(12, 18, 24, 36), 3) returns [15, 21, 27, 39]
 */
fun modifyWoodLength(woods: List<Int>, inches: Int): List<Int> {
/**
 * A carpenter wants to modify the length of woods in inches using a for loop and list comprehensions.
 * Given a list of woods and the amount of inches to be added or subtracted, modify the length of each wood element accordingly.
 *
 * @param woods A list of wood lengths in inches.
 * @param inches The amount of inches to be added or subtracted from each wood length.
 * @return The modified list of wood lengths after adding or subtracting the specified amount of inches.
 *
 * Example:
 * modifyWoodLength(listOf(12, 18, 24, 36), 3) returns [15, 21, 27, 39]
 */
fun modifyWoodLength(woods: List<Int>, inches: Int): List<Int> {

    return woods.map { if (it % 2 == 0) it + inches else it - inches }
}