All Downloads are FREE. Search and download functionalities are using the official Maven repository.

g3201_3300.s3285_find_indices_of_stable_mountains.Solution.kt Maven / Gradle / Ivy

package g3201_3300.s3285_find_indices_of_stable_mountains

// #Easy #Array #2024_09_17_Time_195_ms_(92.68%)_Space_37.5_MB_(48.78%)

class Solution {
    fun stableMountains(height: IntArray, threshold: Int): List {
        val n = height.size
        val list: MutableList = mutableListOf()
        for (i in 0 until n - 1) {
            if (height[i] > threshold) {
                list.add(i + 1)
            }
        }
        return list
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy