Search
⌘K

Leetcode 2334. Subarray With Elements Greater Than Varying Threshold

Find any contiguous subarray of length k such that every element > threshold / k, and return that k (or -1 if none exists). Equivalently, check for a window where k * min(window) > threshold — with n up to 1e5 this reduces to testing window minima across candidate lengths.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.