From: James Edward Gray II Date: 2006-01-20T07:57:23+09:00 Subject: Re: Ruby Quiz #62 On Jan 19, 2006, at 2:22 PM, Andrew Dudzik wrote: > Hi all--just found my way into this list by way of Ruby Quiz, which > looks > amazing Thanks! > and I look forward to participating in successive weeks. I'm a > newcomer to Ruby in general. Then let me welcome you. > I took a few shots at #62 and was unable to come up with anything > that would > terminate in a reasonable amount of time. ("reasonable" = > "overnight") But > 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: Great example. I was looking for one of these yesterday, but kept coming up short. I'm actually wondering if the algorithm couldn't be adapted to handle this. I believe it's possible. The placement of the first block ruins 6 other squares (because of padding). When placed correctly, it only ruins three. I bet the code could be made to spot this... James Edward Gray II