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.
But in O notation it will be 3x vs x² i think this is still better than having nested maps or foreach.
I was tempted to use the array_map(), max() and min() functions but with this solution each array is scanned 3 times. Which doesn't pose a problem, we're fine with small arrays.