LeetCode POTD Solutions

Daily Problem of the Day breakdowns, dry runs, and verified Java / JavaScript implementations.

← Back to Portfolio Home

3904. Smallest Stable Index II

Difficulty: Medium | Date: 2026-09-05

Find the smallest index where the maximum of all elements from the start minus the minimum of all elements to the end is at most k with large constraints (N up to 100,000) using prefix max and suffix min precomputation.

View Solution & Dry Run →