Блог пользователя burakcetin

Автор burakcetin, 12 лет назад, По-английски

Is there any good explanation for the idea behind finding max area sub-rectangle in a histogram problem? And some tasks involving the same idea. It seems to be used in much harder problems as a sub-problem and i am having hard time about it.

  • Проголосовать: нравится
  • -1
  • Проголосовать: не нравится

»
12 лет назад, скрыть # |
 
Проголосовать: нравится -7 Проголосовать: не нравится

Hackerrank-Farmer.

»
12 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I am not sure what problem you are talking about. Is it like this one?

If yes, solution of it is pretty classical and you can read about it here

»
12 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

A simple stack implementation solves this problem, try to see if you can see why.