Ad
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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 through square_ranges via pairs. The problem is, we try to go through pairs 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 then pair in pairs.

    P.S. You shouldn't make a for loop for p variable; work exactly with it, not with s. I mean, p is pair of numbers, therefore, you can access them via p[0] and p[1], right?

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution