/**
 * A carpenter needs to cut various pieces of wood to a specific length.
 * Write a function that takes a list of wood lengths and a blade length as input.
 * The function should return a new list with the lengths of the pieces that can be cut out using the given blade length.
 *
 * Example:
 * cutWood(listOf(5, 8, 9, 12, 15), 7) -> [5]
 * cutWood(listOf(5, 8, 9, 12, 15), 10) -> [5, 8, 9]
 * cutWood(listOf(5, 8, 9, 12, 15), 20) -> [5, 8, 9, 12, 15]
 */
fun cutWood(woodLengths: List<Int>, bladeLength: Int): List<Int> {

    val cutPieces = mutableListOf<Int>()
    for (length in woodLengths) {
        if (length <= bladeLength) {
            cutPieces.add(length)
        }
    }
    return cutPieces
}
/**
 * A carpenter needs to cut various pieces of wood to a specific length.
 * Write a function that takes a list of wood lengths and a blade length as input.
 * The function should return a new list with the lengths of the pieces that can be cut out using the given blade length.
 *
 * Example:
 * cutWood(listOf(5, 8, 9, 12, 15), 7) -> [5]
 * cutWood(listOf(5, 8, 9, 12, 15), 10) -> [5, 8, 9]
 * cutWood(listOf(5, 8, 9, 12, 15), 20) -> [5, 8, 9, 12, 15]
 */
fun cutWood(woodLengths: List<Int>, bladeLength: Int): List<Int> {
/**
 * A carpenter needs to cut various pieces of wood to a specific length.
 * Write a function that takes a list of wood lengths and a blade length as input.
 * The function should return a new list with the lengths of the pieces that can be cut out using the given blade length.
 *
 * Example:
 * cutWood(listOf(5, 8, 9, 12, 15), 7) -> [5]
 * cutWood(listOf(5, 8, 9, 12, 15), 10) -> [5, 8, 9]
 * cutWood(listOf(5, 8, 9, 12, 15), 20) -> [5, 8, 9, 12, 15]
 */
fun cutWood(woodLengths: List<Int>, bladeLength: Int): List<Int> {

    val cutPieces = mutableListOf<Int>()
    for (length in woodLengths) {
        if (length <= bladeLength) {
            cutPieces.add(length)
        }
    }
    return cutPieces
}