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 comment is hidden because it contains spoiler information about the solution
I didn't claim it would be.
However… if anywhere, I think it's acceptable especially in a narrow use case, such as a coding exercise. THe reason: Precisely because it's a narrow use case, it won't cause harm elsewhere.
That said, using refinements would have been a cleaner way to achieve the effect, without reopening standard classes.
In a real system that deals with geometrical objects, I'd expect that each of these objects would respond to
area
anyway.Then it won't work, but the instructions say:
Create a five_num method that takes an array of integers as an argument
so checking for invalid input is not a requirement.