Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
ah, thanks for clarifying. I was sure that's how I read it but I've been calculating the difference between the first and last element (
[2,34,2]
incorrectly yields0
) in a 3 amigo array (which can work with the array sorted).Hi,
From the example in the description, shouldn't the first 3 Amigos be
[2, 34, 2]
, range0
and even parity.Here's what is shown as the result at the moment:
this was a comment on the solution, so didn't think it would be accessible to those that haven't solved the kata yet. anyway, I shall mark any comment with code as spoiler, thanks for the reminder! :)
This was the missing piece 'all methods in ruby that accept a block will also accept a block parameter as the last argument'. Thanks!
This comment is hidden because it contains spoiler information about the solution
sure, I can add a bit more clarity to description as suggested.
Makes sense! I have fixed that now. Also, thanks for that detailed explanation, very helpful
hi,
thanks for pointing that out, but how is changing the input possible like this, and how can I fix that ..
I hadn't changed anything, and tried it again just now with positive result. Odd, have to find out what's going on. I am open to any insight.
I ran the test and it passed. could you run the test on its own under sample tests?
here are the two tests that were reported as fails:
hmm, odd, I ran the test and it passed. could you run the test on its own under sample tests?
here are the two tests that were reported as fails:
thanks for spotting that, checking now.
hey thanks for spotting that, checking now.
Hi,
Sure,the output for
[ [ 1, 0 ], [ 0, 5 ], [ 0, 7 ] ]
should be[ [ 1, 5] ]
, and you are correct in your explanation. We sort out bad packages from the top of the fruit box, so[ 1, 0 ]
and[ 0, 5 ]
gets dealt with first.[0,7]
remains and will have to be discarded (as per condition) since the package can't be populated with a spare.Cool, thanks for the link.
Loading more items...