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
Nah, there's no timeouts for this solution, in line 15 the inline for loops are executed from left to right, meaning that first the program will go through
pairs
, and then will go throughsquare_ranges
viapairs
. The problem is, we try to go throughpairs
without knowing what is this variable (that will be on the next loop), thus an error.Try to swap these loops, so first you get
pairs in square_ranges
, and thenpair in pairs
.P.S. You shouldn't make a for loop for
p
variable; work exactly with it, not withs
. I mean,p
is pair of numbers, therefore, you can access them viap[0]
andp[1]
, right?This comment is hidden because it contains spoiler information about the solution