← All problemsSign in

3903. Smallest Stable Index I

LeetCodeArrayPrefix SumOpen on judge ↗

You are given an integer array nums of length n and an integer k. For each index i, define its instability score as max(nums[0..i]) - min(nums[i..n - 1]). In other words: - max(nums[0..i]) is the largest value among the elements from index 0 to index i. - min(nums[i..n - 1]) is the smallest value among the elements from index i to index n - 1. An index i is called stable if its instability sc

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start