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.
I forgot to reset "initialOk" if the remaining squares were bigger than 1x1. So this is my final solution to this problem that should take care of every possibility that could occur.
The given Problem cries for a recursive solution (at least to my eyes ;-) ). The only thing that makes it a bit strange to solve is the fact that only the initial "paper" shouldn't be already a square. If you end up having a square while cutting it, it's fine.
This wouldn't work for a call with "SqInRect.sqInRect(3, 4)" or "SqInRect.sqInRect(6, 4)"
Before iterating over the array a simple length check could throw all walks away, that aren't of the correct size.