Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Largest Rectangle in Histogram
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Lu Dang
September 25, 2016
Technology
0
210
Largest Rectangle in Histogram
http://www.lintcode.com/en/problem/largest-rectangle-in-histogram/
Lu Dang
September 25, 2016
Tweet
Share
Other Decks in Technology
See All in Technology
Amazon S3 Vectorsを使って資格勉強用AIエージェントを構築してみた
usanchuu
3
450
外部キー制約の知っておいて欲しいこと - RDBMSを正しく使うために必要なこと / FOREIGN KEY Night
soudai
PRO
12
5.2k
What happened to RubyGems and what can we learn?
mikemcquaid
0
270
Greatest Disaster Hits in Web Performance
guaca
0
200
セキュリティについて学ぶ会 / 2026 01 25 Takamatsu WordPress Meetup
rocketmartue
1
300
Tebiki Engineering Team Deck
tebiki
0
24k
Kiro IDEのドキュメントを全部読んだので地味だけどちょっと嬉しい機能を紹介する
khmoryz
0
180
GSIが複数キー対応したことで、俺達はいったい何が嬉しいのか?
smt7174
3
150
CDK対応したAWS DevOps Agentを試そう_20260201
masakiokuda
1
240
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
5
1.6k
AzureでのIaC - Bicep? Terraform? それ早く言ってよ会議
torumakabe
1
510
15 years with Rails and DDD (AI Edition)
andrzejkrzywda
0
180
Featured
See All Featured
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
700
Everyday Curiosity
cassininazir
0
130
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
120
The Mindset for Success: Future Career Progression
greggifford
PRO
0
230
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
280
What does AI have to do with Human Rights?
axbom
PRO
0
2k
Building the Perfect Custom Keyboard
takai
2
680
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
320
GraphQLとの向き合い方2022年版
quramy
50
14k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.9k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.8k
Skip the Path - Find Your Career Trail
mkilby
0
54
Transcript
2 1 5 6 2 3 0 positions heights 0
2 maxVal = 0 i == 0
2 1 5 6 2 3 0 positions heights 0
2 maxVal = 0 i == 1
2 1 5 6 2 3 0 positions heights i
== 1 maxVal = max(0, (i - 0) * 2) = 2 2
2 1 5 6 2 3 0 positions heights 0
1 i == 1 maxVal = max(0, (i - 0) * 2) = 2
2 1 5 6 2 3 0 positions heights 0
1 maxVal = 2 i == 2 2 5
2 1 5 6 2 3 0 positions heights 0
1 maxVal = 2 i == 3 2 5 3 6
2 1 5 6 2 3 0 positions heights 0
1 maxVal = 2 i == 4 2 5 3 6
2 1 5 6 2 3 0 positions heights 0
1 maxVal = max(2, (i - 3) * 6) = 6 i == 4 2 5 6
2 1 5 6 2 3 0 positions heights 0
1 maxVal = max(6, (i - 2) * 5) = 10 i == 4 10
2 1 5 6 2 3 0 positions heights 0
1 maxVal = 10 i == 4 2 2
2 1 5 6 2 3 0 positions heights 0
1 maxVal = 10 i == 5 2 2 5 3
2 1 5 6 2 3 0 positions heights 0
1 maxVal = 10 i == 6 2 2 5 3
2 1 5 6 2 3 0 positions heights 0
1 maxVal = max(10, (i - 5) * 3) = 10 i == 6 2 2 3
2 1 5 6 2 3 0 positions heights 0
1 maxVal = max(10, (i - 2) * 2) = 10 i == 6 8
2 1 5 6 2 3 0 positions heights maxVal
= max(10, (i - 0) * 1) = 10 i == 6 6
“maxVal is 10.” 2 1 5 6 2 3 0
10