• + 0 comments

    I think its best explained as a bunch of blocks being stacked upon eachother, sometimes a block will be heavier than others, othertimes it wont stack on another block. By caching WHERE the blocks start and end and how high they are at that point, you can find the maximum value of the graph. This doesn't mean you'd know exactly where the maximum is, making it a much simpler problem that can be solved O(n * rows)