logo       

RE: Coding challenge (on Ruby Garden): msg#00785

lang.ruby.general

Subject: RE: Coding challenge (on Ruby Garden)

David Naseby wrote:

>> From: George Ogata [mailto:g_ogata@xxxxxxxxxxxxxxxx]
>> This bit looks strange to me, though:
>>
>> if (arr_of_arr.length - (arr_of_arr - arr).length) > arr.length
>> ^^^^^^^^^^^^^^^^
>
> Of course, you are right.. this line should be
> if (arr_of_arr.length - (arr_of_arr.delete_if{|a| a == arr}) > arr.length
>
> with this change, this latest failure passes. Can't wait for the next one
> ;)
>
> David

Hope I didn't keep you waiting too long... ;)

one_in_each([1,2,3,4],[[1,3,4],[1,2,3,4],[2,3,4],[]])

should be false.



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise