/**
 * Given a list of layer values and a threshold, return the indices of the layers
 * where the values are greater than or equal to the threshold.
 *
 * @param layerValues A list of numeric values representing different layers.
 * @param threshold Threshold value to compare against.
 * @return A list of indices where the layer values are greater than or equal to the threshold.
 */
fun findLayers(layerValues: List<Double>, threshold: Double): List<Int> {

    val indices = mutableListOf<Int>()

    for ((index, value) in layerValues.withIndex()) {
        if (value >= threshold) {
            indices.add(index)
        } else {
            break
        }
    }

    return indices
}
/**
 * Given a list of layer values and a threshold, return the indices of the layers
 * where the values are greater than or equal to the threshold.
 *
 * @param layerValues A list of numeric values representing different layers.
 * @param threshold Threshold value to compare against.
 * @return A list of indices where the layer values are greater than or equal to the threshold.
 */
fun findLayers(layerValues: List<Double>, threshold: Double): List<Int> {
/**
 * Given a list of layer values and a threshold, return the indices of the layers
 * where the values are greater than or equal to the threshold.
 *
 * @param layerValues A list of numeric values representing different layers.
 * @param threshold Threshold value to compare against.
 * @return A list of indices where the layer values are greater than or equal to the threshold.
 */
fun findLayers(layerValues: List<Double>, threshold: Double): List<Int> {

    val indices = mutableListOf<Int>()

    for ((index, value) in layerValues.withIndex()) {
        if (value >= threshold) {
            indices.add(index)
        } else {
            break
        }
    }

    return indices
}