Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1124. Longest Well-Performing Interval
Convert days to +1 (hours>8) and -1 (hours<=8) and find the longest contiguous subarray whose sum is >0. This reduces to finding the farthest pair of prefix sums with a positive difference, solvable in O(n) using prefix-sum techniques (monotonic stack or hashmap).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.