Both of those are valid answers. The problem is simply to determine the largest area.
Thanks, -- Raul On Tue, Jun 20, 2017 at 11:58 AM, 'Pascal Jasmin' via Programming <[email protected]> wrote: > is the answer to your example, 6x2 or 4x3? > > > > ________________________________ > From: Raul Miller <[email protected]> > To: Programming forum <[email protected]> > Sent: Tuesday, June 20, 2017 11:30 AM > Subject: [Jprogramming] largest rectangle problem > > > > 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 > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
