g3201_3300.s3285_find_indices_of_stable_mountains.Solution Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of leetcode-in-java Show documentation
Show all versions of leetcode-in-java Show documentation
Java-based LeetCode algorithm problem solutions, regularly updated
The newest version!
package g3201_3300.s3285_find_indices_of_stable_mountains;
// #Easy #Array #2024_09_15_Time_1_ms_(100.00%)_Space_44.5_MB_(100.00%)
import java.util.ArrayList;
import java.util.List;
public class Solution {
public List stableMountains(int[] height, int threshold) {
int n = height.length;
List list = new ArrayList<>();
for (int i = 0; i < n - 1; i++) {
if (height[i] > threshold) {
list.add(i + 1);
}
}
return list;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy