A
Andrew Dudzik
------=_Part_1051_27618755.1137702130810
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Hi all--just found my way into this list by way of Ruby Quiz, which looks
amazing, and I look forward to participating in successive weeks. I'm a
newcomer to Ruby in general.
I took a few shots at #62 and was unable to come up with anything that woul=
d
terminate in a reasonable amount of time. ("reasonable" =3D "overnight") B=
ut
I did look over the posted answer and it seems that the algorithm fails in
the case of a 3x6 truck bed with boxes of sizes 2x3, 1x3, and 1x3--it
concludes that two loads are needed, while the other two solutions give the
correct result of a single load:
###
###
___
###
___
###
I think that the nature of this bug is that placing the largest box in the
corner may exclude an optimal solution--I do not know if this is simply a
problem of orientation, or something larger. As the problem specified
finding the minimum number of trips, I thought that this warranted
discussion.
As I have just joined this list, I shall have to apologize if this has
already been talked about.
------=_Part_1051_27618755.1137702130810--
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Hi all--just found my way into this list by way of Ruby Quiz, which looks
amazing, and I look forward to participating in successive weeks. I'm a
newcomer to Ruby in general.
I took a few shots at #62 and was unable to come up with anything that woul=
d
terminate in a reasonable amount of time. ("reasonable" =3D "overnight") B=
ut
I did look over the posted answer and it seems that the algorithm fails in
the case of a 3x6 truck bed with boxes of sizes 2x3, 1x3, and 1x3--it
concludes that two loads are needed, while the other two solutions give the
correct result of a single load:
###
###
___
###
___
###
I think that the nature of this bug is that placing the largest box in the
corner may exclude an optimal solution--I do not know if this is simply a
problem of orientation, or something larger. As the problem specified
finding the minimum number of trips, I thought that this warranted
discussion.
As I have just joined this list, I shall have to apologize if this has
already been talked about.
------=_Part_1051_27618755.1137702130810--