burakcetin's blog

By burakcetin, 9 years ago, In English

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.

  • Vote: I like it
  • -1
  • Vote: I do not like it

»
9 years ago, # |
  Vote: I like it -7 Vote: I do not like it

Hackerrank-Farmer.

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

  • »
    »
    9 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    Can a simple stack implementation solve this one?

  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Can a simple stack implementation solve "How many rectangles in a given main rectangle" problem , if yes HOW ?