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

g3201_3300.s3285_find_indices_of_stable_mountains.Solution Maven / Gradle / Ivy

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