/**
 * Given an elevation data list and a threshold value, return the indexes of the elements that are not above the threshold.
 *
 * @param elevationData A 2-dimensional list representing the elevation on different points.
 * @param threshold The threshold value for elevation.
 * @return A list of indexes where the elevation is not above the threshold.
 *
 * Example:
 * checkElevationProfiler(listOf(listOf(10, 15, 20), listOf(5, 10, 15), listOf(20, 25, 30)), 15)
 * Output: [1, 2, 4, 5, 7, 8]
 */
fun checkElevationProfiler(elevationData: List<List<Int>>, threshold: Int): List<Int> {

    val indexes = mutableListOf<Int>()

    for (i in elevationData.indices) {
        for (j in elevationData[i].indices) {
            if (elevationData[i][j] <= threshold) {
                indexes.add(i * elevationData[i].size + j + 1)
            }
        }
    }

    return indexes
}

val elevationData = listOf(listOf(10, 15, 20), listOf(5, 10, 15), listOf(20, 25, 30))
val threshold = 15

val notAboveThresholdIndexes = checkElevationProfiler(elevationData, threshold)
/**
 * Given an elevation data list and a threshold value, return the indexes of the elements that are not above the threshold.
 *
 * @param elevationData A 2-dimensional list representing the elevation on different points.
 * @param threshold The threshold value for elevation.
 * @return A list of indexes where the elevation is not above the threshold.
 *
 * Example:
 * checkElevationProfiler(listOf(listOf(10, 15, 20), listOf(5, 10, 15), listOf(20, 25, 30)), 15)
 * Output: [1, 2, 4, 5, 7, 8]
 */
fun checkElevationProfiler(elevationData: List<List<Int>>, threshold: Int): List<Int> {
/**
 * Given an elevation data list and a threshold value, return the indexes of the elements that are not above the threshold.
 *
 * @param elevationData A 2-dimensional list representing the elevation on different points.
 * @param threshold The threshold value for elevation.
 * @return A list of indexes where the elevation is not above the threshold.
 *
 * Example:
 * checkElevationProfiler(listOf(listOf(10, 15, 20), listOf(5, 10, 15), listOf(20, 25, 30)), 15)
 * Output: [1, 2, 4, 5, 7, 8]
 */
fun checkElevationProfiler(elevationData: List<List<Int>>, threshold: Int): List<Int> {

    val indexes = mutableListOf<Int>()

    for (i in elevationData.indices) {
        for (j in elevationData[i].indices) {
            if (elevationData[i][j] <= threshold) {
                indexes.add(i * elevationData[i].size + j + 1)
            }
        }
    }

    return indexes
}

val elevationData = listOf(listOf(10, 15, 20), listOf(5, 10, 15), listOf(20, 25, 30))
val threshold = 15

val notAboveThresholdIndexes = checkElevationProfiler(elevationData, threshold)