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.
my solution is pretty similar, except I used rsort and pop since I figure they're less computationally expensive than shifting an array... although it seems it only makes a difference for massive arrays
This comment is hidden because it contains spoiler information about the solution
if $n is anything other than an integer, then $m isn't a square number, if $m isn't a square number then the solution isn't valid
it might be neat to read, but it has O(N) complexity so the larger the input variable, the longer the function takes to run.
when everything looks like a nail, all you really need is a hammer :)