[Jprogramming] largest rectangle problem

Raul Miller rauldmiller at gmail.com
Tue Jun 20 15:42:21 UTC 2017


Actually, the area of the rectangle I am looking for in that data set
is 12, where the area of the rectangle you proposed is 42. Despite how
famous 42 is as an answer, that rectangle includes empty spaces, so
it's an answer which I have rejected.

I hope this helps.

Thanks,

-- 
Raul

On Tue, Jun 20, 2017 at 11:39 AM, robert therriault
<bobtherriault at mac.com> wrote:
> 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.
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm


More information about the Programming mailing list