/**
 * Given a list of layer thicknesses, this function determines the depths where the thickness exceeds a given threshold.
 *
 * @param layerThicknesses List containing the thickness of each layer.
 * @param threshold The threshold value to compare against the thickness of the layers.
 * @return A list containing the depths where the layer thickness exceeds the given threshold.
 */
fun findLayerDepths(layerThicknesses: List<Int>, threshold: Int): List<Int> {

    val depths = mutableListOf<Int>()
    var currentDepth = 0

    for (thickness in layerThicknesses) {
        if (thickness < threshold) {
            currentDepth += thickness
        } else {
            currentDepth += threshold
            depths.add(currentDepth)
            currentDepth += (thickness - threshold)
        }
    }

    return depths
}
/**
 * Given a list of layer thicknesses, this function determines the depths where the thickness exceeds a given threshold.
 *
 * @param layerThicknesses List containing the thickness of each layer.
 * @param threshold The threshold value to compare against the thickness of the layers.
 * @return A list containing the depths where the layer thickness exceeds the given threshold.
 */
fun findLayerDepths(layerThicknesses: List<Int>, threshold: Int): List<Int> {
/**
 * Given a list of layer thicknesses, this function determines the depths where the thickness exceeds a given threshold.
 *
 * @param layerThicknesses List containing the thickness of each layer.
 * @param threshold The threshold value to compare against the thickness of the layers.
 * @return A list containing the depths where the layer thickness exceeds the given threshold.
 */
fun findLayerDepths(layerThicknesses: List<Int>, threshold: Int): List<Int> {

    val depths = mutableListOf<Int>()
    var currentDepth = 0

    for (thickness in layerThicknesses) {
        if (thickness < threshold) {
            currentDepth += thickness
        } else {
            currentDepth += threshold
            depths.add(currentDepth)
            currentDepth += (thickness - threshold)
        }
    }

    return depths
}