[Jprogramming] largest rectangle problem

'Mike Day' via Programming programming at jsoftware.com
Tue Jun 20 20:49:38 UTC 2017


I've only just seen this.  
I expect it's obvious,  but you ARE looking only for rectangles with "vertical" and "horizontal" sides, i.e. no rotations other than multiples of pi/2 involved?
Thanks,
Mike

Please reply to mike_liz.day at tiscali.co.uk.      
Sent from my iPad

> On 20 Jun 2017, at 16:29, Raul Miller <rauldmiller at gmail.com> wrote:
> 
> Something I stumbled over today.
> 
> 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.
> 
> For example:
> 
>   '*'#"0~2 6 7 4 1 7
> **
> ******
> *******
> ****
> *
> *******
> 
> I'll post a solution later, and I'll be interested in seeing if it's
> basically the only obvious approach or if there's a variety of good
> approaches. (I have reason to believe, though, that there's a better
> way than what I came up with.)
> 
> Thanks,
> 
> -- 
> Raul
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm



More information about the Programming mailing list