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.
This code does not seem adaptable to any array with any hash. When you use "names = names.map { |name| name[:name] }" you are using the key ':name' based on the test cases. So this solution only works based on the test cases.
The pop will return the last element, and if the element does not exists, they will return this element...
Perfect solution, and very different from mine!
This comment is hidden because it contains spoiler information about the solution
I'm wondering this as well. When there's one name how come the output is not " & Bart"?
I see it works but I'm having trouble understanding why the "&" is not returned since it's hardcoded into the string.
I don't see how this works with 1 name since you are always including the &
I like how readable this is compared to the one-liners.