[Jprogramming] largest rectangle problem

robert therriault bobtherriault at mac.com
Tue Jun 20 15:39:31 UTC 2017


I think that you are asking for a rectangle that would enclose all of the *'s minimally. So that there would be spaces within the rectangle but none more than necessary.

I would use something like this:

    '*'#"0~2 6 7 4 1 7
**     
****** 
*******
****   
*      
*******
   ('o' $~ # , >./) 2 6 7 4 1 7
ooooooo
ooooooo
ooooooo
ooooooo
ooooooo
ooooooo
   
Cheers, bob

> On Jun 20, 2017, at 8:29 AM, Raul Miller <rauldmiller at gmail.com> wrote:
> 
> If we have a series of bars of varying height, what's the largest
> rectangle that can be drawn over the bars without covering any empty
> space.



More information about the Programming mailing list