Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
mattmcal
62 days ago
|
parent
|
context
|
favorite
| on:
Many hard LeetCode problems are easy constraint pr...
Yes, you just need to maintain a stack of rectangles ordered from lowest to highest. You only ever have to push and pop the top of the stack, so the runtime is O(n).
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: