Dynamic Programming21 sections · 916 units
Open in CourseQuiz: Shortest Subarray
Knowledge check
Check Your Understanding
In Shortest Subarray with Sum >= K, why do we need a monotonic deque instead of sliding window?
- A.Because window size k is variable
- B.Because we need both min and max
- C.Because we need minimum length, not maximum
- D.Because array contains negative numbers, so prefix sum is not monotonic