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
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
20260204_Midosuji_Tech
takuyay0ne
1
140
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
150
予期せぬコストの急増を障害のように扱う――「コスト版ポストモーテム」の導入とその後の改善
muziyoshiz
1
1.8k
配列に見る bash と zsh の違い
kazzpapa3
1
130
Ruby版 JSXのRuxが気になる
sansantech
PRO
0
140
データの整合性を保ちたいだけなんだ
shoheimitani
8
3.1k
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1k
Oracle Cloud Observability and Management Platform - OCI 運用監視サービス概要 -
oracle4engineer
PRO
2
14k
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
140
会社紹介資料 / Sansan Company Profile
sansan33
PRO
15
400k
IaaS/SaaS管理における SREの実践 - SRE Kaigi 2026
bbqallstars
4
1.8k
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
Featured
See All Featured
Designing for humans not robots
tammielis
254
26k
WCS-LA-2024
lcolladotor
0
450
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
54
エンジニアに許された特別な時間の終わり
watany
106
230k
The Language of Interfaces
destraynor
162
26k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
Rails Girls Zürich Keynote
gr2m
96
14k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.7k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
250
Embracing the Ebb and Flow
colly
88
5k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
120
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